Skip to content

nitro-nightly build crashes Start app in Bun monorepo #3915

Closed

Description

@slovakian

Environment

Runtime: bun (1.3.5; latest)
Nitro: nitro-nightly (3.0.1-20260102-143448-301604f8)

Reproduction

https://github.com/slovakian/nitro-nightly-mono-repro/tree/main

Describe the bug

The nightly build works causes a TanStack Start app scaffolded using the official CLI to fail, but only when uses in a Turbo monorepo (Bun in this case).

Additional context

There are two apps in the repro: nitro-nightly and web. web uses the alpha build and the dev server runs fine. nitro-nightly uses the nightly build and the dev server crashes, but only within the monorepo. Outside of the monorepo, the dev server executes without issue.

Logs

error when starting dev server:
Error: Node env worker should be initialized before sending messages.
    at NodeEnvRunner.sendMessage (.../nitro-nightly/dist/_dev.mjs:142:28)
    at new FetchableDevEnvironment (.../nitro-nightly/dist/_build/vite.plugin.mjs:169:18)
    at createFetchableDevEnvironment (.../nitro-nightly/dist/_build/vite.plugin.mjs:159:9)
    ...

Activity

  1. imbytecat commented on Jan 8, 2026

    @imbytecat

    I'm unable to use nitro-nightly with Bun's default isolated install (v1.3+). Do you know a workaround?

    ┌─ server#build > cache miss, executing 210e91ae99dd8847
    $ vite build
    failed to load config from C:\Users\imbytecat\Developer\clashflow\apps\server\vite.config.ts
    error during build:
    Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'nitro' imported from C:\Users\imbytecat\Developer\clashflow\node_modules\.bun\[email protected]+e
    4f074767c606137\node_modules\nitro-nightly\dist\_build\common.mjs
        at Object.getPackageJSONURL (node:internal/modules/package_json_reader:316:9)
        at packageResolve (node:internal/modules/esm/resolve:768:81)
        at moduleResolve (node:internal/modules/esm/resolve:858:18)
        at defaultResolve (node:internal/modules/esm/resolve:990:11)
        at #cachedDefaultResolve (node:internal/modules/esm/loader:712:20)
        at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:729:38)
        at ModuleLoader.resolveSync (node:internal/modules/esm/loader:758:52)
        at #resolve (node:internal/modules/esm/loader:694:17)
        at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:614:35)
        at ModuleJob.syncLink (node:internal/modules/esm/module_job:143:33)
    error: script "build" exited with code 1
    
  2. LuggaPugga commented on Jan 15, 2026

    @LuggaPugga

    I just tried building Nitro locally and installing it using bun link, and it’s working oddly
    When using the nitro-nighly install it throws

    error when starting dev server:
    Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './runtime/meta' is not defined by "exports" in /home/luca/Documents/Projects/faststats/node_modules/.bun/node_modules/nitro/package.json imported from /home/luca/Documents/Projects/faststats/node_modules/.bun/[email protected]+9960fdce8850e0ae/node_modules/nitro-nightly/dist/vite.mjs
        at exportsNotFound (node:internal/modules/esm/resolve:313:10)
        at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
        at packageResolve (node:internal/modules/esm/resolve:774:12)
        at moduleResolve (node:internal/modules/esm/resolve:858:18)
        at defaultResolve (node:internal/modules/esm/resolve:990:11)
        at #cachedDefaultResolve (node:internal/modules/esm/loader:737:20)
        at ModuleLoader.resolve (node:internal/modules/esm/loader:714:38)
        at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:293:38)
        at #link (node:internal/modules/esm/module_job:208:49)
    error: script "dev" exited with code 1
    
  3. pi0 commented on Jan 15, 2026

    @pi0
    Member

    Please make sure to specifiy dependency like below: (if left key is "nitro-nightly" it is wrong, linking locally does not also works usually)

    "nitro": "npm:nitro-nightly@latest",
    
  4. LuggaPugga commented on Jan 15, 2026

    @LuggaPugga

    Please make sure to specifiy dependency like below: (if left key is "nitro-nightly" it is wrong, linking locally does not also works usually)

    "nitro": "npm:nitro-nightly@latest",
    

    I did that actually

  5. imbytecat commented on Jan 15, 2026

    @imbytecat

    Please make sure to specifiy dependency like below: (if left key is "nitro-nightly" it is wrong, linking locally does not also works usually)

    "nitro": "npm:nitro-nightly@latest",
    

    I did that actually

    I solved it via adding nitro to bunfig public hoist pattern

    [install]
    publicHoistPattern = ["@types/*", "bun-types", "nitro*"]
  6. LuggaPugga commented on Jan 15, 2026

    @LuggaPugga

    Thanks gonna try this out

    Please make sure to specifiy dependency like below: (if left key is "nitro-nightly" it is wrong, linking locally does not also works usually)

    "nitro": "npm:nitro-nightly@latest",
    

    I did that actually

    I solved it via adding nitro to bunfig public hoist pattern

    [install]
    publicHoistPattern = ["@types/", "bun-types", "nitro"]

    Just tried and that fixed it thanks

  7. pi0 commented on Jan 15, 2026

    @pi0
    Member

    @imbytecat can you help updating nightly docs to include your node re bun? 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending triageNot looked at by a maintainer yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions