Next.js Discord

Discord Forum

serverComponentsExternalPackages is ignored when using pnpm

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Hi,

I'm using transformersjs on the server side and when bundling with pnpm it doesn't ignore the packages listed in serverComponentsExternalPackages and throws the error Module parse failed: Unexpected character ''

If I use npm it correctly ignores the following packages,

serverComponentsExternalPackages: ['sharp', 'onnxruntime-node']


Any other ways to ignore those packages? Should I try to do this at the webpack level?

0 Replies