-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
./node_modules/mapbox-gl/dist/mapbox-gl.css Module build failed: TypeError: Cannot read property 'toFixed' of undefined #9345
Comments
We haven't heard about anything similar to your problem unfortunately. I'll have to close this because it's not a GL JS issue, but if you find out what that was, please let us know so that others can find it. You could also try asking on StackOverflow. |
I have fixed it by the following two steps:
Thanks |
I've got the exact same issue with my webpack setup. On production builds all images get optimized via the imagemin-webpack-plugin which uses svgo for svg's. When importing the mapbox css in my sass file like this:
I get the same error as described here. But when I import the source css like this:
I have no compiling errors, but I seem to be missing all svg images in the mapbox styles. |
@myselfsum You mind specifying which jsx page did you change?the one in the node_modules or? |
@SitCode1993, I have removed "imports mapbox-gl.css" from the main jsx page which is rendering in the browser and wriiten import state like the above way in index.html page. |
When I'm running
in |
we solved ELIFECYCLE problem by removing tsconfig.json before build. |
I have integrated Mapbox GL JS (Version: 1.8.0) in a React (Version: 16.12.0) and it is working fine. But when I am trying run the build command it throws me the below error:
./node_modules/mapbox-gl/dist/mapbox-gl.css
Module build failed: TypeError: Cannot read property 'toFixed' of undefined
at Array.filter ()
at Array.filter ()
at Array.filter ()
at Array.forEach ()
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:
react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] staging:
env-cmd .env.staging npm run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] staging script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Can anybody tell me why react build command throwing the error whereas npm start command not?
The text was updated successfully, but these errors were encountered: