Which project does this relate to?
Router
Describe the bug
I have been trying the new RSC feature in Tanstack Start, its great in dev mode, but built failed saying -
"default" is not exported by "node_modules/react-dom/server.react-server.js"
[ node_modules/@tanstack/react-router/dist/esm/ssr/renderRouterToStream.js:2:8 ]
import ReactDOMServer from "react-dom/server";
───────┬──────
╰──────── Missing export
i have gone a head and searched node_modules in tanstack router file and searched online, what i found is react-dom/server doesn't have a default export, as its used in tanstack router files
|
import ReactDOMServer from 'react-dom/server' |
and
|
import ReactDOMServer from 'react-dom/server' |
Your Example Website or App
https://github.com/TanStack/router/tree/main/examples/react/start-rscs
Steps to Reproduce the Bug or Issue
- create a new tanstack start app
- add @vitejs/plugin-rsc plugin
- configure vite config
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import rsc from "@vitejs/plugin-rsc";
import { defineConfig } from "vite";
const config = defineConfig({
plugins: [
tanstackStart({
rsc: {
enabled: true,
},
}),
rsc(),
viteReact(),
],
resolve: {
tsconfigPaths: true,
},
});
export default config;
5. build the app
### Expected behavior
build failing saying
[MISSING_EXPORT] Error: "default" is not exported by "node_modules/react-dom/server.react-server.js".
╭─[ node_modules/@tanstack/react-router/dist/esm/ssr/renderRouterToString.js:1:8 ]
│
1 │ import ReactDOMServer from "react-dom/server";
│ ───────┬──────
│ ╰──────── Missing export
───╯
[MISSING_EXPORT] Error: "default" is not exported by "node_modules/react-dom/server.react-server.js".
╭─[ node_modules/@tanstack/react-router/dist/esm/ssr/renderRouterToStream.js:2:8 ]
│
2 │ import ReactDOMServer from "react-dom/server";
│ ───────┬──────
│ ╰──────── Missing export
### Screenshots or Videos
<img width="1061" height="380" alt="Image" src="https://github.com/user-attachments/assets/30d0ad90-8443-4552-bcc0-e90fa1684f16" />
### Platform
- Router / Start Version: "@tanstack/react-start": "^1.167.34", "@tanstack/react-router": "^1.168.19"
- OS: Linux (EndeavourOS)
- Browser: helium browser 0.11.1.1
- Browser Version: 147.0.7727.55
- Bundler: vite
- Bundler Version: 8.0.8
### Additional context
the fix might be like
```js
import * as ReactDOMServer from "react-dom/server";
Which project does this relate to?
Router
Describe the bug
I have been trying the new RSC feature in Tanstack Start, its great in dev mode, but built failed saying -
"default" is not exported by "node_modules/react-dom/server.react-server.js"
[ node_modules/@tanstack/react-router/dist/esm/ssr/renderRouterToStream.js:2:8 ]
import ReactDOMServer from "react-dom/server";
───────┬──────
╰──────── Missing export
i have gone a head and searched node_modules in tanstack router file and searched online, what i found is react-dom/server doesn't have a default export, as its used in tanstack router files
router/packages/react-router/src/ssr/renderRouterToStream.tsx
Line 2 in c857087
router/packages/react-router/src/ssr/renderRouterToString.tsx
Line 1 in c857087
Your Example Website or App
https://github.com/TanStack/router/tree/main/examples/react/start-rscs
Steps to Reproduce the Bug or Issue