mapbox-gl-directions icon indicating copy to clipboard operation
mapbox-gl-directions copied to clipboard

NODE_ENV is undefined, triggers console error in production

Open dafnarosenblum opened this issue 3 years ago • 6 comments

create-react-app with webpack >=4, I'm getting: You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build. From mapbox-gl-directions.js:5436 in production. Adding process.env.NODE_ENV to the string in line 5413 results with printing undefined. Adding process.env.NODE_ENV to the console.error in line 5436 results with printing 'production'. I was wondering if there is a way to avoid this error in the log. Thanks.

dafnarosenblum avatar Feb 17 '21 10:02 dafnarosenblum

@dafnarosenblum is there an update on this issue. I have the same problem when using @mapbox/mapbox-gl-directions 4.1.0 in create-react-app. Even setting NODE_ENV=production on my production machine doesn't resolve this issue.

GabrielMassaroFHNW avatar May 24 '21 10:05 GabrielMassaroFHNW

This is also true for Angular applications and I too have been unable to find a way to solve this. Anyone have any suggestions?

mikeomeara1 avatar Sep 14 '21 18:09 mikeomeara1

Reporting this since we installed mapbox-gl-directions (4.1.0) in our React app too. Webpack 5.35.1 and React 17.0.2.

Tried a bunch of things with how our webpack builds run and no fix found so far.

FinnLawrence avatar Mar 23 '22 08:03 FinnLawrence

We have the same console error in our production code. We used mapbox-gl-directions (4.1.0). It does not matter what application it is (Angular, React, Vue of whatever).

jeroenburgers avatar Apr 19 '22 08:04 jeroenburgers

I have same console error. I'm using mapbox-gl-directions v4.1.0. I think, I can't draw line, point and polygon with using draw tools because of console error

ndaaktan avatar Apr 25 '22 10:04 ndaaktan

Same problem. I'm using [email protected] I built an app by Laravel, Webpack, Vue

tonviet712 avatar Feb 02 '24 10:02 tonviet712