Commit daf7854
fix: add resolve.dedupe for react/react-dom to prevent duplicate instances
In pnpm strict mode, Vite's dependency pre-bundling can create
separate React module instances for different dependency chains
(e.g. react-router-dom importing its own React copy). This causes
"Invalid hook call" errors when Link/useContext tries to access
React internals from a different instance than the one rendering.
Adding resolve.dedupe ensures all packages resolve to the same
physical React module.
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent a61ab29 commit daf7854
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments