Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssr bug in dev when using prerender #12924

Closed
dadamssg opened this issue Jan 31, 2025 · 1 comment
Closed

ssr bug in dev when using prerender #12924

dadamssg opened this issue Jan 31, 2025 · 1 comment

Comments

@dadamssg
Copy link
Contributor

dadamssg commented Jan 31, 2025

I'm using React Router as a...

framework

Reproduction

Clone the completed address-book tutorial here: https://github.com/dadamssg/address-book

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 449.53 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.2 - ~/.volta/tools/image/node/20.18.2/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 10.8.2 - ~/.volta/tools/image/node/20.18.2/bin/npm
    pnpm: 9.9.0 - ~/Library/pnpm/pnpm
    bun: 1.1.38 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 129.1.70.117
    Chrome: 132.0.6834.160
    Safari: 18.2
  npmPackages:
    @react-router/dev: ^7.1.4 => 7.1.4 
    @react-router/node: ^7.1.4 => 7.1.4 
    @react-router/serve: ^7.1.4 => 7.1.4 
    react-router: ^7.1.4 => 7.1.4 
    vite: ^5.4.11 => 5.4.14

Used Package Manager

npm

Expected Behavior

I expect flipping the ssr true flag to have an effect. This seems to only happen when a prerender array is also defined even though it's not relevant to the current route.

Actual Behavior

If you start with ssr: true, changing it should have an effect. Video of issue here: https://youtu.be/epqpC3KmMM0

rr-ssr.480.mov

I'm using actions/loaders so it should immediately blow up when ssr is toggled off. I have to restart the dev server for the change to actually take affect.

@brophdawg11
Copy link
Contributor

This should be resolved by #12948 and available in the next release.

The dev server should now error if it finds a loader in a non-pre-rendered route with ssr:false without requiring a server restart. It does require a browser reload to trigger the error at the moment.

@brophdawg11 brophdawg11 removed their assignment Feb 11, 2025
@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Feb 11, 2025
@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants