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

Can't build v2 with create-react-app #10242

Closed
800147 opened this issue Dec 25, 2020 · 1 comment
Closed

Can't build v2 with create-react-app #10242

800147 opened this issue Dec 25, 2020 · 1 comment

Comments

@800147
Copy link

800147 commented Dec 25, 2020

Hello, when I use mapbox-gl v2.0.1 with create-react-app everything is ok when i run npm run start but when I build the app with npm run build and then try to run the builded site, map is not showing up and there is an error in console

ReferenceError: y is not defined

Looks like there is some issue with webpack used in create-react-app and mapbox-gl package.

mapbox-gl-js version: 2.0.1

browser: Firefox 84.0, Chrome 87.0.4280.88

Steps to Trigger Behavior

  1. Make an app using create-react-app (I made it with typescript template)
  2. Install mapbox-gl v2 package and add map to page
  3. Build the app using npm run build and try to run the build

Link to Demonstration

screenshot

github: https://github.com/800147/mapbox-2-test

Expected Behavior

Map is showing up

Actual Behavior

Map is not showing up, error in console

@mourner
Copy link
Member

mourner commented Dec 25, 2020

Duplicate of #10173

@mourner mourner marked this as a duplicate of #10173 Dec 25, 2020
@mourner mourner closed this as completed Dec 25, 2020
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