You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using generouted to build a routing setup (for react-router) based on file system layout (NextJS inspired). Interestingly, the whole setup using import.meta leads to a lazy loading of react-router. I am not sure why, as the RouterProvider is part of the initial import sequence.
The initial log files looks like:
VITE v3.2.5 ready in 248 ms
➜ Local: http://127.0.0.1:5173/
➜ Network: use --host to expose
Sourcemap for "/Users/sebastian/Workspace/vite-react-router-bug/node_modules/.pnpm/react-router-dom@6.4.4_biqbaboplfbrettd7655fr4n2y/node_modules/react-router-dom/dist/index.js" points to missing source files
Sourcemap for "/Users/sebastian/Workspace/vite-react-router-bug/node_modules/.pnpm/react-router@6.4.4_react@18.2.0/node_modules/react-router/dist/index.js" points to missing source files
10:15:45 [vite] ✨ new dependencies optimized: react-router-dom
10:15:45 [vite] ✨ optimized dependencies changed. reloading
This all happens on directly on the start of the server and leads to some unwanted side-effects (in our larger app) as it seems. When restarting the dev-server the warning is gone and the application works fine.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
We are using
generouted
to build a routing setup (for react-router) based on file system layout (NextJS inspired). Interestingly, the whole setup usingimport.meta
leads to a lazy loading ofreact-router
. I am not sure why, as theRouterProvider
is part of the initial import sequence.The initial log files looks like:
This all happens on directly on the start of the server and leads to some unwanted side-effects (in our larger app) as it seems. When restarting the dev-server the warning is gone and the application works fine.
This is the relevant import-related code in
generouted
We have also tried the following to work-around the issue:
This added to the root-level
App.tsx
fixes the issue. No warning. No application bug.Reproduction
https://github.com/swernerx/vite-react-router-bug
Steps to reproduce
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: