Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help Wanted] Demo project is not working #67

Open
Tyrannas opened this issue Oct 26, 2021 · 3 comments
Open

[Help Wanted] Demo project is not working #67

Tyrannas opened this issue Oct 26, 2021 · 3 comments

Comments

@Tyrannas
Copy link

Hi,

I tried to reproduce this code https://github.com/ProjectMirador/mirador-annotations/blob/master/demo/src/index.js

Either way, when I run the following snippet, I can open mirador and I can click on "add an annotation", but the moment I try to add it (by clicking on any of the shapes) the app displays a cryptic error : EllipseTool.component.js:110 Uncaught TypeError: Cannot read properties of undefined (reading 'alternate')

NB: I installed mirador-annotations from npm, maybe that's a mistake ? I should only clone the repo ? There is no real install recommandation on the ReadMe.

import Mirador from 'mirador/dist/es/src/index';
import annotationsPlugins from 'mirador-annotations'
// import { miradorImageToolsPlugin } from 'mirador-image-tools';
import LocalStorageAdapter from 'mirador-annotations/lib/LocalStorageAdapter'

const config = {
  id: 'demo',
  windows: [{
    manifestId: 'https://purl.stanford.edu/sn904cj3429/iiif/manifest',
  }],
  annotation: {
    adapter: (canvasId) => new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`),
    // adapter: (canvasId) => new AnnototAdapter(canvasId, endpointUrl),
    exportLocalStorageAnnotations: true, // display annotation JSON export button
  },
  window: {
    defaultSideBarPanel: 'annotations',
    sideBarOpenByDefault: true,
  },
};

Mirador.viewer(config, [
   ...annotationsPlugins,
]);

Thank you very much

@davide-negretti
Copy link

Bumping this, as I have the same problem

@davide-negretti
Copy link

I tested it with mirador-annotations 0.4.0 and it's working. The bug is present in version 0.5.0.

@davide-negretti
Copy link

@Tyrannas I solved by updating react from version 16 to version 17 in my project's package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants