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
I'm migrating my Proof-of-Concept MapLibre from a static python Flask instance into a fairly complex React environment (a Plone/Volto block). In the static environment I used a script import of: 'https://unpkg.com/[email protected]/dist/index.min.js'
The rest of my MapLibre migration is working, but I have not yet been able to find a way to reliably import your package.
One solution that "nearly works" is using react-script-tag to import the library from unpkg.com like so:
This setup works fine after a refresh, but does not appear to have loaded the library by the time it's first called. And I have not found a way to await the library load.
I had hoped a local version yarn add maplibre-contour would provide a better solution. But when used as suggested in your readme the library fails to load with the following error:
/home/rea/src/rah-site/node_modules/maplibre-contour/dist/index.cjs:23
mlcontour = chunk(sharedChunk);
^
ReferenceError: Blob is not defined
at /home/rea/src/rah-site/node_modules/maplibre-contour/dist/index.cjs:2171:1
at define (/home/rea/src/rah-site/node_modules/maplibre-contour/dist/index.cjs:23:17)
at Object.<anonymous> (/home/rea/src/rah-site/node_modules/maplibre-contour/dist/index.cjs:2131:1)
at Module._compile (node:internal/modules/cjs/loader:1196:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Object.maplibre-contour (/home/rea/src/rah-site/rah-site/external commonjs "maplibre-contour":1:1) sswp> !!! Script exited with code 1
I have attempted a number of other imports from within the maplibre-contour/dist/ area. But the best I was able to do is promise that gets imported a as module that appears to have no usable content. I have tried versions 0.0.5, 0.0.6, 0.0.7.
I have pulled back this repo and I can npm run build it. After that I'm in over my head in attempting to locate the issue, or even which import variation offers my best chance of success.
I can see you had a prior bug like this. So I'm hoping you have some insight, even with the little I've provided here.
Thanks!
The text was updated successfully, but these errors were encountered:
That's weird, Blob is almost universally supported by browsers. My guess is that plone/volta/ScriptTag setup you have is trying to load maplibre contour from a server-side rendering context? The async function makes sense if if can avoid the server trying to do it and only do it in the client?
First thanks for the great code!
I'm migrating my Proof-of-Concept MapLibre from a static python Flask instance into a fairly complex React environment (a Plone/Volto block). In the static environment I used a script import of: 'https://unpkg.com/[email protected]/dist/index.min.js'
The rest of my MapLibre migration is working, but I have not yet been able to find a way to reliably import your package.
One solution that "nearly works" is using react-script-tag to import the library from unpkg.com like so:
This setup works fine after a refresh, but does not appear to have loaded the library by the time it's first called. And I have not found a way to await the library load.
I had hoped a local version
yarn add maplibre-contour
would provide a better solution. But when used as suggested in your readme the library fails to load with the following error:I have attempted a number of other imports from within the maplibre-contour/dist/ area. But the best I was able to do is promise that gets imported a as module that appears to have no usable content. I have tried versions 0.0.5, 0.0.6, 0.0.7.
I have pulled back this repo and I can
npm run build
it. After that I'm in over my head in attempting to locate the issue, or even which import variation offers my best chance of success.I can see you had a prior bug like this. So I'm hoping you have some insight, even with the little I've provided here.
Thanks!
The text was updated successfully, but these errors were encountered: