Skip to content

Feature request: Add configuration for running SWR on simulated runtimes on the server #4083

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

Open
IcaroG opened this issue Feb 3, 2025 · 2 comments

Comments

@IcaroG
Copy link

IcaroG commented Feb 3, 2025

After #1832, useSWR() throws an error when executing on the server with React 18, even when running on a simulated runtime such as react-ssr-prepass.

Would you consider a flag for SWR config that would preserve the previous behavior: throwing the promise even on React 18 + server?
I’d be happy to create the PR for it if this gets the green light.

@IcaroG
Copy link
Author

IcaroG commented Mar 14, 2025

Hi @shuding,

Sorry for the ping, but I was wondering if I could submit a PR for this issue. My current use case relies on this fix to proceed with upgrading SWR. Let me know if this works for you!

Thanks in advance!

@shuding
Copy link
Member

shuding commented Apr 1, 2025

Hey @IcaroG, yes feel free to open a PR for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants