You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I face a build a error when i use serverComponentsExternalPackages which is suggested in the readme. (i use it to prevent a error at dev complication time using turborepo.)
The issue with this approach is that it breaks standard building in NextJS 15(rc) - it works fine in Nextjs 14.
Error in question
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but go
t: undefined.
at nk (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:56806)
at nk (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:56729)
at nC (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59773)
at nE (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62787)
at nk (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:53732)
at nC (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59773)
at nE (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62787)
at nk (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:53732)
at nC (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59773)
at nE (/home/-----/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62787) {
digest: '3315014112'
}
Error occurred prerendering page "/dash". Read more: https://nextjs.org/docs/messages/prerender-error
I'm not sure whether this bug originates in Nextjs or if it's something they've changed in the RC version. (seems to be the component AblyProvider which causes the error)
I've used npx create-next-app@rc for that one, and had to install ably package with --legacy-peer-deps flag enabled (there is a pretty old known issue with npm and peerDependencies where it doesn't automatically pick prerelease versions like rc releases).
If you would like to check that repo locally, you would need to install deps as npm install --legacy-peer-deps too. After that npm run dev for regular dev build and npm run dev:turbo for turbopack.
Could you please take a look at the sample app and see if you have any different configuration for your project?
I think i may understand why you were unable to reproduce locally. I wasn't importing my ably provider wrapper via next/dynamic (only figured it out from viewing your example repo). After switching that import over it seems to work perfectly fine.
Summary
I face a build a error when i use
serverComponentsExternalPackages
which is suggested in the readme. (i use it to prevent a error at dev complication time using turborepo.)The issue with this approach is that it breaks standard building in NextJS 15(rc) - it works fine in Nextjs 14.
Error in question
I'm not sure whether this bug originates in Nextjs or if it's something they've changed in the RC version. (seems to be the component
AblyProvider
which causes the error)Thanks!
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: