fix(react): add resolve.dedupe for react/react-dom to prevent CJS multi-instance

React 19.2.5 is pure CJS. Rollup's CJS→ESM interop can create separate scoped
ReactSharedInternals objects for react and react-dom, causing hooks to see a null
dispatcher on the server build. resolve.dedupe forces a single shared instance.
This commit is contained in:
ZhenYi 2026-05-12 22:41:44 +08:00
parent e185885557
commit 066bb4e83d

View File

@ -24,6 +24,7 @@ export default defineConfig({
alias: {
"@": path.resolve(__dirname, "./src"),
},
dedupe: ["react", "react-dom"],
},
server: {
host: true,