-
I have applied the examples of the repository https://github.com/mapbox/mapbox-react-examples to maplibre: Locally, everything works well. In the end I ran The demotiles are not displayed on astridx.github.io. And there are Errors in Console. But I am not sure where the error is exactly. Maybe someone with more experience can give me a tip. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
@webberig Any chance you can take a look at it? |
Beta Was this translation helpful? Give feedback.
-
OK, it's a complicated problem 😅 ... The build process uses Babel to transpile all code (including dependencies) to ES5. @HarelM Maplibre-gl has this weird script: https://github.com/maplibre/maplibre-gl-js/blob/main/rollup/bundle_prelude.js. do you know what this script does exactly ? It looks like it converts a chunk of Javascript into a Blob string and define that as a background worker. My guess this is the part that babel can't handle properly. @astridx for now, the only solution I can offer is you need to take control over the build process (ie. eject) and exclude mapbox-gl in the babel-loader configuration. I can't honestly identify the best solution. By definition babel should not break code while transpiling ES6 to ES5 so you can consider this to be a bug there, but maybe we can change our architecture so it doesn't make babel trip ? |
Beta Was this translation helpful? Give feedback.
-
Thanks @wipfli. I have just tried this. That seems to be the solution indeed. |
Beta Was this translation helpful? Give feedback.
#1011