diff --git a/.changeset/seven-times-pump.md b/.changeset/seven-times-pump.md new file mode 100644 index 0000000000..082e4fdfba --- /dev/null +++ b/.changeset/seven-times-pump.md @@ -0,0 +1,6 @@ +--- +'@tanstack/start-plugin-core': patch +'@tanstack/start-server-core': patch +--- + +fix(start): emit client entry scripts from the root route manifest. When `scriptFormat: 'iife'` and the entry chunk has static-import siblings (e.g. an extracted runtime via `optimization.runtimeChunk: 'single'`), the manifest now includes those async siblings before the async client entry in root route scripts, fixing hydration for IIFE bundles with extracted runtimes. diff --git a/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts b/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts index e638f8319c..5f9aa96e16 100644 --- a/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts +++ b/e2e/react-start/custom-server-rsbuild/rsbuild.config.ts @@ -1,10 +1,65 @@ +import path from 'node:path' import { defineConfig } from '@rsbuild/core' import { pluginReact } from '@rsbuild/plugin-react' import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' +// Stress-test fixture for `` and the start manifest under a +// non-default client chunk layout. The combination that matters for the +// repro is: +// +// - `client.output: 'iife'` — emit the client entry as a self-executing +// script. The manifest uses plain script tags and classic script preloads; +// setting IIFE here exercises that non-module asset path. +// +// - Client `runtimeChunk: 'single'` — extracts the webpack runtime into +// its own chunk. With IIFE plain scripts, the entry can't bootstrap +// until the runtime has executed, so `` has to emit a +// `