fix(web): restore serverExternalPackages for Payload + use --webpack for build
Root cause: Next.js 16 defaults to Turbopack for builds, but Payload CMS's richtext-lexical imports .css files that fail during route collection in Node ESM context. Fix: add @payloadcms/richtext-lexical and @payloadcms/next back to serverExternalPackages so Next.js skips their internal imports during route collection. Use --webpack explicitly since Turbopack production builds are incompatible with Payload (payloadcms/payload#14786). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,8 @@ const config: NextConfig = {
|
||||
"payload",
|
||||
"@payloadcms/db-postgres",
|
||||
"@payloadcms/db-sqlite",
|
||||
"@payloadcms/richtext-lexical",
|
||||
"@payloadcms/next",
|
||||
"sharp",
|
||||
],
|
||||
turbopack: {
|
||||
|
||||
Reference in New Issue
Block a user