Skip to content

Unstable_rsc-framework-mode: newly created app and updated apps starts with error #191

@lnxon

Description

@lnxon

After React update in 11DEC, I noted that the newly created RR7 RSC app and apps with packages updated to @latest starts with error.

Image

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'],
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions