Code Monkey home page Code Monkey logo

Comments (2)

mathewjordan avatar mathewjordan commented on July 3, 2024 1

Hi @buccalon, The ReferenceError: document is not defined error I believe is the ultimate source issue here. The depedency for OpenSeadragon expects the browser document to exist and doesn't play well in a node environment. When Next is building its trying to render OpenSeadragon and then crashing...

There is a solution though, but it must be done through a dynamic import package in next/dynamic

  1. I suggest creating a component to the side that can operate outside of your Markdown pages.

components/IIIFViewer.jsx

and in that...

import dynamic from "next/dynamic";

const CloverIIIF = dynamic(() => import("@samvera/clover-iiif"), {
  ssr: false,
});

const IIIFViewer = ({ id }) => {
  return <CloverIIIF id={id} />;
};

export default IIIFViewer;

image

  1. Then in each of your markdown files...
import IIIFViewer from '../../components/IIIFViewer'

# Relatório dos trabalhos executados na Floresta Nacional da Tijuca de 1º de Janeiro a 31 de Dezembro de 1890, por Manuel Gomes Archer

<IIIFViewer id="https://iiif.tiju.ca/1891-relatorio-archer" />

## Contexto
...

Also, you may want to update Clover to latest npm i @samvera/clover-iiif@latest to accomodate the new id prop rather than manifestId.

Let me know if that helps. Best - Mat

from clover-iiif.

buccalon avatar buccalon commented on July 3, 2024

@mathewjordan thanks for taking the time and updating the docs, it worked!

image

from clover-iiif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.