Description
Can you reproduce the problem with latest npm?
Yes (including npm 5).
Description
There seems to be an incompatibility between CRA 1.0+ and the react-mapbox-gl
component. This bug was not present before CRA 1.0, and only shows up in production mode, which makes me think it's a webpack 2.0 related issue.
Expected behavior
See https://github.com/davidascher/mapbox-repro-bug for a minimal test case (single component render -- works in development mode, doesn't work in production mode)
Actual behavior
In production mode (yarn build
+ serve -s build
) , the map doesn't show and there's an incomprehensible traceback (as it's minified).
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): react-scripts@1.0.6node -v
: v7.9.0npm -v
: 5.0.0 (but it happened with 4.x as well)
Then, specify:
- Operating system: OSX
- Browser and version: Chrome 58.0.3029.110
Reproducible Demo
Source: https://github.com/davidascher/mapbox-repro-bug
(trivial CRA repo with one dependency).
Live site showing bug: https://build-wnyrhmqiph.now.sh/
/cc @alex3165 as he is the maintainer of react-mapbox-gl AFAICT.