This error happened everytime I deploy my react code to vercel. I solved this error by put this on scripts.
put this thing on your package.json, when you see
CI=false npm run build
Don't put quotation as a string on env variable -vercel
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
There is also a built-in environment variable called NODE_ENV. You can read it from process.env.NODE_ENV
. When you run npm start, it is always equal to 'development'
, when you run npm test it is always equal to 'test', and when you run npm run build to make a production bundle, it is always equal to 'production'. You cannot override NODE_ENV manually. This prevents developers from accidentally deploying a slow development build to production.
You can create an env varaible on Vercel called CI and set it to false, that works too