Replies: 2 comments
-
Hi @Vinorcola! The What might work better is giving Vite a direct hint with Try watching your terminal for the Something like this could help: // vite.config.ts
optimizeDeps: {
// Keep this to help the scanner
entries: ["app/**/*.{js,jsx,ts,tsx}"],
// Add this to force-include the tricky ones
include: [
'react-router-dom',
'@remix-run/router'
// ... and any others that cause reloads
]
} This tells Vite to pre-bundle them at startup, which should help prevent the reloads. |
Beta Was this translation helpful? Give feedback.
-
For our app I found the vite option did not seem to help, but adding the flag in the react-router config fixed it: import type { Config } from '@react-router/dev/config';
export default {
future: {
unstable_optimizeDeps: true,
},
} satisfies Config; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm facing very recurrent issues with Vite that display the following message:
This is very annoying since it provoques unwanted page reloads and navigations issues (aka links & form submits not working).
I tried to add the following conf in
vite.config.ts
:But this is not working.
Is there a way to make vite optimize all dependencies app-wide at startup?
Beta Was this translation helpful? Give feedback.
All reactions