Skip to content

bug: [ERROR] Could not resolve "bun" #2602

@capaj

Description

@capaj

Provide environment information

System:
OS: Linux 6.14 Ubuntu 25.04 25.04 (Plucky Puffin)
CPU: (16) x64 AMD Ryzen 7 9700X 8-Core Processor
Memory: 30.48 GB / 60.44 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.16.0 - /home/capaj/.nvm/versions/node/v22.16.0/bin/node
Yarn: 1.22.22 - /home/capaj/.yarn/bin/yarn
npm: 10.9.2 - /home/capaj/.nvm/versions/node/v22.16.0/bin/npm
pnpm: 10.18.2 - /home/capaj/.local/share/pnpm/pnpm
bun: 1.3.0 - /home/capaj/.bun/bin/bun

Describe the bug

bundling fails with error when I try to import from bun

Reproduction repo

not applicable

To reproduce

  1. import { SQL } from 'bun'
(base)  ✘ capaj@capaj-ryzen-7-5900x  ~/work-repos/groas.ai/groas/packages/trigger   dev ●  bunx trigger.dev dev

Trigger.dev (4.0.4)
------------------------------------------------------
Key: Version | Task | Run
------------------------------------------------------
│
▲  Warning: The "bun" runtime is currently experimental, and certain features may not work, especially opentelemetry instrumentation of 3rd party packages.
○ Building local worker…
✘ [ERROR] Could not resolve "bun"

    ../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]._9c831d09eb3a9acf6495d3da78bd04b0/node_modules/drizzle-orm/bun-sql/driver.js:1:20:
      1 │ import { SQL } from "bun";
        ╵                     ~~~~~

  You can mark the path "bun" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "bun"

    ../api/src/db/db.ts:1:20:
      1 │ import { SQL } from 'bun'
        ╵                     ~~~~~

  You can mark the path "bun" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


│
│  💡 Get a fix for this error using AI

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions