javascriptreactjsbrowserify

Error affecting vercel deployment but not a local build


I keep getting this error when compiling on Vercel or Heroku, but not on my PC.

Module not found: Error: You attempted to import /vercel/path0/node_modules/console-browserify/index.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

This is an error I get when running npm run build on Vercel, it does not occur on a local build.

I have tried changing the webpack version (it just gives a different error). I have no idea where console-browserify is used (apart from react itself).


Solution

  • The problem was resolved by just removing all console.log, console.warn, etc. from the program!