-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Hi! I tried upgrading a project to Next.js 16 which uses turbopack by default and ran into an error. It appears to be due to the dynamic require in base.tsx
It would be great if the dynamic require wasn't necessary. It could also have unintended consequences in other bundlers such as embedding the entire package.json in the bundle.
I'm able to work around the issue by setting serverExternalPackages: ["pipedrive"], in Next.js config for now.
Here is the error:
▲ Next.js 16.1.1 (Turbopack)
Creating an optimized production build ...
> Build error occurred
Error: Turbopack build failed with 2 errors:
./node_modules/pipedrive/dist/versions/v1
Module not found: Can't resolve './ROOT/node_modules/pipedrive/dist/versions/v1/package.json'
server relative imports are not implemented yet. Please try an import relative to the file you are importing from.
https://nextjs.org/docs/messages/module-not-found
./node_modules/pipedrive/dist/versions/v2
Module not found: Can't resolve './ROOT/node_modules/pipedrive/dist/versions/v2/package.json'
server relative imports are not implemented yet. Please try an import relative to the file you are importing from.
https://nextjs.org/docs/messages/module-not-found
at <unknown> (https://nextjs.org/docs/messages/module-not-found)
at <unknown> (https://nextjs.org/docs/messages/module-not-found)
Created https://github.com/mariusc23/next-turbo-pipedrive to demonstrate the issue.
Metadata
Metadata
Assignees
Labels
No labels