Skip to content

init: a Nitro preset inside a conditional spread reads as the build's preset #4107

Open

Description

@QuinnsCode

Found in the #2167 research (notes/tanstack-start-top-ten.md). josephmqiu/game-theory-model's vite config:

nitro({ serverDir: "./server", ...(isElectronBuild ? { preset: "node-server" } : {}) })

startLayout (packages/cli/src/glue/start-layout.ts) matches preset: "node-server" with a regex, so init warns the preset starts its own server and drops NITRO_PRESET=standard, though the normal build sets no preset. Without the variable Nitro's default (node-server) builds a server the desktop can't mount.

Fix idea: only take a preset that is a direct property of the nitro({...}) call (not inside ...( / ?), else treat it as unset; one table row in the start-layout test.

Part of #2167.

🤖 Generated with Claude Code

Activity

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

    future-ideaLane: a good idea for later, not needed now

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions