Replies: 11 comments 18 replies
-
Hi. We faced these errors as well with the same configuration when migrating to v7. To resolve this, we moved all the window-related code, such as Our app is a PWA that uses Vite PWA. It seems that Based on my initial impression, the new Framework approach may not be the best choice for building a pure SPA or PWA, particularly if you don't intend to use SSR in the future. The Custom Framework approach feels more straightforward and less limiting. |
Beta Was this translation helpful? Give feedback.
-
i have the same issue, i feel like i'm missing something |
Beta Was this translation helpful? Give feedback.
-
Seconding this. I feel like when SSR is set to false, the application should not render anything below the The default-exported Page by the |
Beta Was this translation helpful? Give feedback.
-
I am also getting I am building a UI for a Tauri/Electron app, I can not have any SSR, even for development. This effectively fully blocks any migration to v7 beyond the Vite plugin setup (I was using I think this is worthy of a bug report? |
Beta Was this translation helpful? Give feedback.
-
I have:
...
build: {
ssr: false,
},
... and
...
ssr: false,
... However, Vite still tries to build the SSR bundle: ...
$ npm run build
vite v5.4.11 building SSR bundle for production... This change solved the problem: --- a/package.json
+++ b/package.json
...
"scripts": {
- "build": "cross-env NODE_ENV=production react-router build",
+ "build": "vite build",
"dev": "react-router dev",
- "start": "cross-env NODE_ENV=production react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc"
},
... |
Beta Was this translation helpful? Give feedback.
-
Where is the RR team to comment on this issue. Very concerning. It leaves the impression that the RR team is over-indexing on SSR (at cost of SPA). I had high hopes for RR7 but, for SPA apps, TSR is starting to look like the better option. |
Beta Was this translation helpful? Give feedback.
-
+1, been burnt by this using several web APIs, including AudioContext and SpeechRecognition. I would switch to "library mode," but this gives up the |
Beta Was this translation helpful? Give feedback.
-
As suggested above, custom framework mode will get you what we had in RRv6, which is client-side routing w/ option to run a client side loader. Even then there are some oddities such as referring to fallback element as hydrationFallbackElement, which is a real head-scratcher when you're building a SPA (#12687 (comment)). I have mixed feeling about RR7 - on one hand, I'm really happy to see a stronger Next alternative, as I will NEVER use a Vercel anything, but I feel like RR team has a bit of tunnel vision going on chasing Next and SSR at the cost of keeping their base in mind. SSR is great for blogs and shopping sites, but there are still strong use cases for SPA and the best developers will choose the best tool for the job (vs. getting onboard the latest hype train). Also, I was excited about and waiting for typing support, but you get it only if you're using the Vite framework plugin, which does not apply to custom framework afaict. |
Beta Was this translation helpful? Give feedback.
-
Yeah this is a pretty insanely big blocker. I'm trying to migrate an existing SPA to get some pre-rendering on certain routes, with no plans to use SSR. I'd guess most people using RR7 framework are in the same boat. Bummer |
Beta Was this translation helpful? Give feedback.
-
The documentation is downright misleading. https://reactrouter.com/upgrading/router-provider gives the very clear impression that migrating an SPA is a self-contained process, after which, SSR support can be optionally added. Not to mention the configuration API. In what world does |
Beta Was this translation helpful? Give feedback.
-
This will be fixed by #13023 |
Beta Was this translation helpful? Give feedback.
-
Hi,
Why react-router starting in SSR mode, besides the flag is set to false in
react-router.config.ts
.I'm getting:
I'm using pnpm v9.13.2
Node is on version 23.3.0
React 18.3
Beta Was this translation helpful? Give feedback.
All reactions