Skip to content

[Turbopack] LICENSE file parsing error when using drizzle-orm/libsql #82881

@madebycm

Description

@madebycm

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

  1. Clone the repository
git clone https://github.com/madebycm/turbopack-license-bug
cd turbopack-license-bug
  1. Install dependencies
npm install
  1. Run build with Turbopack
npx next build --turbopack

The 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 build

This blocks Turbopack adoption for any application using Drizzle ORM with SQLite/LibSQL.

PACK-5319

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions