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

NODE_ENV is undefined, triggers console error in production #273

Open
dafnarosenblum opened this issue Feb 17, 2021 · 6 comments
Open

NODE_ENV is undefined, triggers console error in production #273

dafnarosenblum opened this issue Feb 17, 2021 · 6 comments

Comments

@dafnarosenblum
Copy link

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.

@GabrielMassaroFHNW
Copy link

@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.

@mikeomeara1
Copy link

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

@FinnLawrence
Copy link

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.

@jeroenburgers
Copy link

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).

@ndaaktan
Copy link

ndaaktan commented Apr 25, 2022

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

@tonviet712
Copy link

Same problem. I'm using mapbox-gl-directions@4.1.1
I built an app by Laravel, Webpack, Vue

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

7 participants