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 example misuses React Router v6 #227

Closed
is2ei opened this issue Sep 25, 2023 · 2 comments · Fixed by #276
Closed

SSR example misuses React Router v6 #227

is2ei opened this issue Sep 25, 2023 · 2 comments · Fixed by #276
Labels
good first issue Good for newcomers

Comments

@is2ei
Copy link

is2ei commented Sep 25, 2023

Describe the bug

I was trying to use SSR example.
/~https://github.com/vitejs/vite-plugin-react/tree/v4.1.0/playground/ssr-react

What I expect is that the example works correctly.

What actually happening is that the example misuses React Router v6 as if it is v5.
React Router v6 has breaking changes but the commit 1ea4577 did nothing with that.

For example, it uses context prop on StaticRouter

/~https://github.com/vitejs/vite-plugin-react/tree/v4.1.0/playground/ssr-react/src/entry-server.jsx#L7

But StaticRouter doesn't have context prop.

https://reactrouter.com/en/main/router-components/static-router

Reproduction

/~https://github.com/vitejs/vite-plugin-react/tree/v4.1.0/playground/ssr-react

Steps to reproduce

Run npm install followed by npm run dev.

System Info

% npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
Need to install the following packages:
  envinfo@7.10.0
Ok to proceed? (y)

  System:
    OS: macOS 13.5.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 8.46 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
  Browsers:
    Chrome: 117.0.5938.88
    Safari: 16.6
  npmPackages:
    @vitejs/plugin-react: ^4.1.0 => 4.1.0


### Used Package Manager

npm

### Logs

_No response_

### Validations

- [X] Follow our [Code of Conduct](/~https://github.com/vitejs/vite-plugin-react/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](/~https://github.com/vitejs/vite-plugin-react/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](/~https://github.com/vitejs/vite-plugin-react/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](/~https://github.com/vitejs/vite-plugin-react/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@is2ei
Copy link
Author

is2ei commented Sep 26, 2023

@ArnaudBarre ArnaudBarre added good first issue Good for newcomers and removed pending triage labels Oct 16, 2023
@ArnaudBarre
Copy link
Member

Thanks for the report!
I will tackle this after other issues in my backlog. Feel free to send a PR if you know how to improve this

@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants