nitro icon indicating copy to clipboard operation
nitro copied to clipboard

node-cluster preset not working

Open mhuggins7278 opened this issue 2 months ago • 2 comments

Environment

when defining the preset as node-cluster. The following error is encountered when running build.

error during build: Error: Cannot resolve module "./runtime/node-server" (from: /Users/MHuggins/github/glg/ts-start-poc/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected][email protected]_/node_modules/nitro/dist/presets.mjs)

Reproduction

When running build with the preset set to node-cluster the build fails.

I'm using vite and tanstack-start.

import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import { defineConfig } from "vite";
import tsConfigPaths from "vite-tsconfig-paths";
import viteReact from "@vitejs/plugin-react";
import { nitro } from "nitro/vite";

export default defineConfig({
  server: {
    port: 3000,
  },
  build: {
    sourcemap: "hidden",
  },
  ssr: {
    noExternal: ["@mui/*"],
  },
  plugins: [
    tsConfigPaths({
      projects: ["./tsconfig.json"],
    }),
    tanstackStart({
      spa: {
        enabled: true,
      },
    }),
    nitro(
      // nitro config goes here, e.g.
      { config: { preset: "node-cluster" } },
    ),
    viteReact(),
  ],
});

Describe the bug

Build fails

Additional context

No response

Logs


mhuggins7278 avatar Nov 03 '25 20:11 mhuggins7278

Can you try latest nightly with "nitro": "npm:nitro-nightly" ?

pi0 avatar Nov 03 '25 21:11 pi0

after swapping to nightly

Image

mhuggins7278 avatar Nov 04 '25 02:11 mhuggins7278

Thanks for report. Should be fixed by #3762

pi0 avatar Nov 08 '25 18:11 pi0