denoland/celld

Public

celld deploy's esbuild pass rejects bare Node builtin specifiers

ST

celld 0.2.1.

`celld deploy` re-bundles the input with its own esbuild pass that has no Node resolution. Dependencies spell builtins both ways (`from "os"` and `from "node:os"`), and the bare forms fail the deploy as unresolvable package names, while the `node:`-prefixed forms are recognized and passed through.

**Repro shape:** deploy any bundle whose module graph contains `import ... from "os"` (or `fs`, `worker_threads`, `buffer`, …) — extremely common via npm dependencies — and the deploy errors. The same bundle deploys fine once every bare builtin is rewritten to its `node:` form.

**Workaround (ours):** an esbuild `onResolve` plugin in our own pre-bundle step that rewrites bare builtins to `node:*` externals. It works, but every dependency's spelling choice currently decides deployability, which feels like something celld's bundler should normalize itself (a one-line alias table for `builtinModules`).

Related: `node:fs/promises` at runtime is an inert stub whose methods return non-promises (no `.then`), which breaks callers whose error handling is built on the promise contract — concretely `@smithy/shared-ini-file-loader` does `readFile(...).then(parse).catch(swallow)`, and with the stub the `.then` access itself throws synchronously before `.catch` attaches. A spec-shaped 'everything rejects ENOENT' stub would take every SDK swallow path down its designed branch. Happy to file this as a separate issue if you prefer.

  1. ryassigned bartlomieju3 months ago on GitHub

  2. steventsaoclosed3 months ago on GitHub

  3. bartlomiejureferenced 9c0ca09ef5d53 months ago on GitHub

  4. bartlomiejureferenced bc0e29cddf303 months ago on GitHub

  5. bartlomiejureferenced 89e4ffc53a143 months ago on GitHub

  6. ruqqqreferenced this in Move celld to v0.3.0: native cron and native D1, deleting three workarounds #622 months ago on GitHub

  7. ruqqqreferenced 25a4a9108fb92 months ago on GitHub