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

The map does not appear #329

Open
homerokzam opened this issue Jun 1, 2021 · 3 comments
Open

The map does not appear #329

homerokzam opened this issue Jun 1, 2021 · 3 comments

Comments

@homerokzam
Copy link

homerokzam commented Jun 1, 2021

Describe the bug
An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/api/#transpiling-v2

The error started to happen after updating the @urbica/react-map-gl lib

To Reproduce
Occurs only after publishing to server (docker). Running locally the error does not occur.

Screenshots
Screen Shot 2021-06-01 at 16 06 57

Desktop (please complete the following information):

  • OS: Mac OSX
  • Browser Chrome Version 90.0.4430.212 (Official Build) (x86_64)
  • react-map-gl v1.14.3
  • react v17.0.2
@franciscoarruda
Copy link

I have the same problem

@franciscoarruda
Copy link

franciscoarruda commented Jul 8, 2021

I found a way to fix the problem:

npm i worker-loader

Then:

import mapboxgl from 'mapbox-gl';

export default function Map() {

mapboxgl.workerClass = require('worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker').default;

...

@LewAndrade
Copy link

I stumbled upon the same issue, my production app is hosted on AWS S3, and only there the error occurs. I couldn't figure out how you solved the error, could you help me? I'm using react-map-gl v5.2.0.

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

3 participants