You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bundle is missing react and react-dom which (because they are peer denedencies) are declared as externals in the rollup options of the vite build config. (alpha.9 and alpha.10 bundles also lack react/jsx-runtime but that has been changed on main.)
Mirador is loaded when the peer dependencies are also provided via script tags, but it only took me a few clicks to encounter a reference error (specifically selecting the index sidebar panel for a manifest with structures).
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/mirador@{version to be released yet}/dist/mirador.min.js"><!-- actually used a local build from main --></script>
So a better way would be to provide an additional bundle that also provides the missing peer dependencies.
We also previously discussed offering bundles that already contain some of the plugins, that's a different issue but it should be considered while deciding on an approach to tackle this issue.
We should not require people to build their own Mirador builds with npm if they just want to use it as-is.
The text was updated successfully, but these errors were encountered:
lutzhelm
added
the
embed
Issues related to installing / embedding Mirador in another application
label
Feb 14, 2025
Since alpha.9, embedding does no longer work as it is described in the README just by adding a CDN bundle to an HTML doc:
The bundle is missing
react
andreact-dom
which (because they are peer denedencies) are declared as externals in the rollup options of the vite build config. (alpha.9 and alpha.10 bundles also lackreact/jsx-runtime
but that has been changed onmain
.)Mirador is loaded when the peer dependencies are also provided via script tags, but it only took me a few clicks to encounter a reference error (specifically selecting the index sidebar panel for a manifest with structures).
So a better way would be to provide an additional bundle that also provides the missing peer dependencies.
The CDNs work in different ways:
We also previously discussed offering bundles that already contain some of the plugins, that's a different issue but it should be considered while deciding on an approach to tackle this issue.
We should not require people to build their own Mirador builds with npm if they just want to use it as-is.
The text was updated successfully, but these errors were encountered: