-
Notifications
You must be signed in to change notification settings - Fork 119
Description
After React update in 11DEC, I noted that the newly created RR7 RSC app and apps with packages updated to @latest starts with error.
This issue affects:
A- Newly created RSC app from
npx create-react-router@latest --template remix-run/react-router-templates/unstable_rsc-framework-mode
B- Apps with packages updated to @latest following security recommendation
Some of apps categorized as A and B show error above after npm run dev.
This does NOT happen in production build; npm run build -> npm start -> no error.
To reproduce:
1- Create new app with
npx create-react-router@latest --template remix-run/react-router-templates/unstable_rsc-framework-mode
or
apply package update following React's security recommendation to existent apps.
2- npm run dev
3- You see the error.
Workaround:
Edit the vite.config.ts, adding optimizeDeps.
export default defineConfig({
plugins: [
tailwindcss(),
tsconfigPaths(),
reactRouterRSC(),
rsc(),
devtoolsJson(),
],
// INSERT LINES BELOW
optimizeDeps: {
include: ['react-router/dom'],
},
});