ProjectMirador / mirador-dl-plugin

a Mirador 3 plugin that adds manifest-provided download links to the window options menu
https://mirador-download-plugin.netlify.com/
Other
6 stars 7 forks source link

Update Dependencies Branch - Invalid hook call... #43

Closed ewlarson closed 4 years ago

ewlarson commented 4 years ago

I'm working to add the M3 mirador-dl-plugin to the B1G Geoportal. I'm running into some issues with the plugin that are beyond me.

I'm running: mirador@^3.0.0-beta.0 and a local build of the update-dependencies branch, because it appears to be the near future of this plugin.

Here's my WIP feature branch

Alone, the new Mirador beta runs well within my GeoBlacklight instance. When I add the download plugin branch webpack compiles correctly, but when you load a page with mirador in it you see: "Invalid hook call..." ... "... error occurred in the <WithStyles(MiradorDownloadDialog)> component".

Screen Shot 2019-12-18 at 12 18 02 PM

Maybe this is related to react-iframe-comm being generally unsupported and adding "Mismatching Versions of React and React DOM"... https://reactjs.org/warnings/invalid-hook-call-warning.html https://github.com/ProjectMirador/mirador/issues/2863 https://github.com/pbojinov/react-iframe-comm/pull/14

Screen Shot 2019-12-18 at 12 46 50 PM

I'm hoping someone else has encountered this before. If anyone has any advice on how to circumvent this issue, I'd greatly appreciate it.

mejackreed commented 4 years ago

I think this might be how you are importing Mirador. If you are importing the es modules version and the umd versions this error can be raised. Do you have. a branch you could share?

mejackreed commented 4 years ago

ALso I think we need to 🚢 this and a new version to work with the beta.0 release https://github.com/ProjectMirador/mirador-dl-plugin/pull/42

ewlarson commented 4 years ago

Thanks for the quick feedback @mejackreed

Here's my feature branch: https://github.com/BTAA-Geospatial-Data-Project/geoportal/tree/feature/mirador-download-plugin

Mirador import statement is here: https://github.com/BTAA-Geospatial-Data-Project/geoportal/blob/feature/mirador-download-plugin/app/javascript/m3_viewer.js

ewlarson commented 4 years ago

Error was resolved long ago.