Getting a build error when using turbopack in next@15.4.1
Unanswered
Birman posted this in #help-forum
BirmanOP
I have tested the build without turbopack on 15.4.1, it builds correctly, on 15.3.5 it builds correctly with turbopack. Is this a better-auth edge case because the route mentioned is used by better-auth in the build error.
▲ Next.js 15.4.1 (Turbopack)
- Environments: .env
Creating an optimized production build ...
✓ Finished writing to disk in 215ms
✓ Compiled successfully in 6.9s
✓ Linting and checking validity of types
Collecting page data ...TypeError: Cannot read properties of undefined (reading 'string')
at Module.V (.next/server/chunks/[root-of-the-server]__b959b432..js:171:17635)
at module.exports.201673 (.next/server/chunks/[root-of-the-server]b959b432._.js:171:34582)
at instantiateModule (.next/server/chunks/[turbopack]_runtime.js:630:23)
at getOrInstantiateModuleFromParent (.next/server/chunks/[turbopack]_runtime.js:681:12)
at esmImport (.next/server/chunks/[turbopack]_runtime.js:162:20)
at module.exports.250090 (.next/server/chunks/[root-of-the-server]b959b432._.js:171:2635)
at instantiateModule (.next/server/chunks/[turbopack]_runtime.js:630:23)
at getOrInstantiateModuleFromParent (.next/server/chunks/[turbopack]_runtime.js:681:12)
at esmImport (.next/server/chunks/[turbopack]runtime.js:162:20)
at module.exports.201673 (.next/server/chunks/[root-of-the-server]__b959b432..js:171:11639)
Provide feedback for Turbopack builds at https://github.com/vercel/next.js/discussions/77721
type: 'Error'
}
Removed some turbopack warnings because the message was too big to post here
next build --turbo
▲ Next.js 15.4.1 (Turbopack)
- Environments: .env
Creating an optimized production build ...
✓ Finished writing to disk in 215ms
✓ Compiled successfully in 6.9s
✓ Linting and checking validity of types
Collecting page data ...TypeError: Cannot read properties of undefined (reading 'string')
at Module.V (.next/server/chunks/[root-of-the-server]__b959b432..js:171:17635)
at module.exports.201673 (.next/server/chunks/[root-of-the-server]b959b432._.js:171:34582)
at instantiateModule (.next/server/chunks/[turbopack]_runtime.js:630:23)
at getOrInstantiateModuleFromParent (.next/server/chunks/[turbopack]_runtime.js:681:12)
at esmImport (.next/server/chunks/[turbopack]_runtime.js:162:20)
at module.exports.250090 (.next/server/chunks/[root-of-the-server]b959b432._.js:171:2635)
at instantiateModule (.next/server/chunks/[turbopack]_runtime.js:630:23)
at getOrInstantiateModuleFromParent (.next/server/chunks/[turbopack]_runtime.js:681:12)
at esmImport (.next/server/chunks/[turbopack]runtime.js:162:20)
at module.exports.201673 (.next/server/chunks/[root-of-the-server]__b959b432..js:171:11639)
Provide feedback for Turbopack builds at https://github.com/vercel/next.js/discussions/77721
Build error occurred[Error: Failed to collect page data for /api/[auth]/[...all]] {
type: 'Error'
}
Removed some turbopack warnings because the message was too big to post here