NuxtN
Nuxt17mo ago
2 replies
Mike

How do I find origin of node module warnings?

Hello!
When I start my app I get 4 console errors like this:
 ERROR  (node:8460) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

I've set "type": "module" in my package.json so I suspect this warning is coming from a dependency. However I don't know how to find which dependency. Is there a better way than removing dependencies one by one to find the culprit?
I've tried running the app with NODE_OPTIONS='--trace-warnings' pnpm dev but this doesn't make a difference
Was this page helpful?