Nextjs: how to debug production locally because development is working perfectly

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!