Skip to content

Commit bbe1b9c

Browse files
committed
fix: add react-router/dom to optimizeDeps array
1 parent a4eb937 commit bbe1b9c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-router-dev/vite/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = (_config) => {
831831
// Pre-bundle router dependencies to avoid router duplicates.
832832
// Mismatching routers cause `Error: You must render this element inside a <Remix> element`.
833833
"react-router",
834+
"react-router/dom",
834835
// Check to avoid "Failed to resolve dependency: react-router-dom, present in 'optimizeDeps.include'"
835836
...(hasDependency("react-router-dom")
836837
? ["react-router-dom"]
@@ -849,6 +850,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = (_config) => {
849850

850851
// see description for `optimizeDeps.include`
851852
"react-router",
853+
"react-router/dom",
852854
"react-router-dom",
853855
],
854856
},

0 commit comments

Comments
 (0)