-
Couldn't load subscription status.
- Fork 3k
Open
Labels
Description
Describe the Bug
When trying to build with Turbopack - there is an error from the @payloadcms/db-d1-sqlite package.
> pnpm build --turbopack
...
> Build error occurred
Error: Turbopack build failed with 2 errors:
./node_modules/.pnpm/@esbuild+darwin-arm64@0.25.11/node_modules/@esbuild/darwin-arm64/README.md
Unknown module type
This module doesn't have an associated type. Use a known file extension, or register a loader for it.
Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders
Import trace:
App Route:
./node_modules/.pnpm/@esbuild+darwin-arm64@0.25.11/node_modules/@esbuild/darwin-arm64/README.md
./node_modules/.pnpm/esbuild@0.25.11/node_modules/esbuild/lib/main.js
./node_modules/.pnpm/esbuild-register@3.6.0_esbuild@0.25.11/node_modules/esbuild-register/dist/node.js
./node_modules/.pnpm/drizzle-kit@0.31.5/node_modules/drizzle-kit/api.js
./node_modules/.pnpm/@payloadcms+drizzle@3.61.0_@cloudflare+workers-types@4.20251014.0_payload@3.61.0_graphql@16.11.0_typescript@5.9.3_/node_modules/@payloadcms/drizzle/dist/sqlite/requireDrizzleKit.js
./node_modules/.pnpm/@payloadcms+db-d1-sqlite@3.61.0_@cloudflare+workers-types@4.20251014.0_payload@3.61.0_graphql@16.11.0_typescript@5.9.3_/node_modules/@payloadcms/db-d1-sqlite/dist/index.js
./workers/app/payload.config.ts
./workers/app/src/app/(payload)/api/graphql-playground/route.ts
./node_modules/.pnpm/@esbuild+darwin-arm64@0.25.11/node_modules/@esbuild/darwin-arm64/bin/esbuild
Reading source code for parsing failed
An unexpected error happened while trying to read the source code to parse: failed to convert rope into string
Caused by:
- invalid utf-8 sequence of 1 bytes from index 0
See full build log attached:
Link to the code that reproduces this issue
https://github.com/payloadcms/payload/tree/main/templates/with-cloudflare-d1
Reproduction Steps
I managed to bypass the issue in the next.config.mjs like this:
serverExternalPackages: [
'@payloadcms/db-d1-sqlite'
],
OpenNext doesn't yet support Turbopack as per this issue, therefore even if the Turbopack build didn't have errors, it still wouldn't work on Cloudflare/D1 currently, but OpenNext+Turbopack compatibility is currently being worked on, so it'd be nice to fix this build error into Payload as well beforehand.
Which area(s) are affected? (Select all that apply)
db: d1-sqlite
Environment Info
Payload 3.61.0, Node: 25