I have deployed my next js project to netlify. On adding ENV = “test” in environmental variables for next.config.js file build is successful but on setting ENV=“production” the build is failing as show in below screenshots , event though the below errors are not showing in local build , all modules are present.
Its been a week since this has not been resolved , can any one help me out of this ?
actually I have shifted from vercel to netlify , in vercel i didn’t faced any issue with production environment for devDependencies , but in netlify i am facing this issue . Here in my application without devDependencies I am not able to build my next js application in netlify .
Yeah I’ve tried it , by removing node_env variable . It seems build with out node_env by default considering as test environment so dev dependencies are also being imported as well. But production env isn’t resolved .
The solution is to move everything to dependencies instead of devDependencies. I’d advise you to read more about Node.js, npm and package.json to understand the consequences of doing what you are doing.