Next.js Discord

Discord Forum

Next compiling node_modules

Unanswered
Yacare Caiman posted this in #help-forum
Open in Discord
Yacare CaimanOP
I've split my application into a Next app, Node app, and a shared lib (which is a private npm package). The lib and node projects compile fine, but when trying to compile the next project, it seems like it is trying to compile the private package in the node_modules folder. It fails with ./node_modules/@mycompany/lib/utilities.js Module not found: Can't resolve '@/<some module>'. I made sure that tsconfig.json has "exclude": ["node_modules"].

2 Replies