-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin 24.5.0
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 22.7.0
npm: 10.8.2
bun: 1.2.19
Relevant Packages:
next: 15.5.0
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.2
Next.js Config:
output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
Turbopack
Which stage(s) are affected? (leave empty if unsure)
next build (local)
Describe the Bug
Turbopack fails to build when using drizzle-orm/libsql. It incorrectly attempts to parse the LICENSE file from node_modules/@libsql/hrana-client/LICENSE as JavaScript code.
Error output:
Error: Turbopack build failed with 1 errors:
./node_modules/@libsql/hrana-client/LICENSE:1:5
Parsing ecmascript source code failed
> 1 | MIT License
| ^^^^^^^
2 |
3 | Copyright 2023 the sqld authors
4 |
Expected ';', '}' or <eof>
Expected Behavior
Turbopack should not attempt to parse LICENSE files as JavaScript. The build should complete successfully.
Link to the code that reproduces this issue
https://github.com/madebycm/turbopack-license-bug
To Reproduce
- Clone the repository
git clone https://github.com/madebycm/turbopack-license-bug
cd turbopack-license-bug- Install dependencies
npm install- Run build with Turbopack
npx next build --turbopackThe build will fail with the LICENSE parsing error.
Additional Context
Important: This bug only occurs when importing from drizzle-orm/libsql:
- ✅ Works:
import { createClient } from '@libsql/client' - ❌ Fails:
import { drizzle } from 'drizzle-orm/libsql'
The issue appears to be related to how Turbopack handles transitive dependencies when certain import patterns are used.
Workaround: Use standard Webpack build without --turbopack flag:
npx next buildThis blocks Turbopack adoption for any application using Drizzle ORM with SQLite/LibSQL.