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

create-react-app (react-scripts 4.0.1) not working with react-map-gl 6.0.3 #1292

Closed
marc-slingshot opened this issue Jan 11, 2021 · 2 comments

Comments

@marc-slingshot
Copy link

I am having trouble getting react-scripts and react-map-gl working together in the production build. It works when running npm run start, but the result of npm run build gives errors.

I have a repo showing the issue here - https://github.com/marc-slingshot/create-react-app-with-react-map-gl

Downgrading to 5.2.12 works. Could this be related to mapbox-gl v2? I noticed similar (but not exact) problems on this older issue thread - #176

Steps to reproduce

  1. clone this repo git clone https://github.com/marc-slingshot/create-react-app-with-react-map-gl.git
  2. add mapbox API token to .env.local
REACT_APP_MAPBOX_TOKEN=<your mapbox token>
  1. npm i
  2. npm run build
  3. npm i -g serve
  4. npx serve -s build
  5. open up http://localhost:5000, open up dev tools, notice errors

I get the following error:

Uncaught ReferenceError: y is not defined
    at a915e7a2-d12d-45dc-b9bc-45bf5baa8c10:1
    at a915e7a2-d12d-45dc-b9bc-45bf5baa8c10:1
    at a915e7a2-d12d-45dc-b9bc-45bf5baa8c10:1
@marc-slingshot
Copy link
Author

marc-slingshot commented Jan 11, 2021

hrm.... looks like it's mapbox-gl upstream then according to this other open issue - #1266 and mapbox/mapbox-gl-js#10173

@Pessimistress
Copy link
Collaborator

Duplicate of #1266

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

2 participants