My nextjs setup is running perfectly in development. When do a build, all is building as it should. But when we serve production locally we get
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Now, I know that it's probably because of a mixup of named imports or something but since it's such a large application, isn't there a way to debug production locally?
I already saw the documentation regarding NODE_OPTIONS='--inspect'
thanks!
To check either your project working fine in production or not:
Build the project using this command
npm run build
If any error occurs, the build command will fail. If the build command is successfully ran, you can check the project in production mode using this command:
npm run start