Description
Environment
- Operating System: Linux
- Node Version: v18.20.3
- Nuxt Version: 3.15.3
- CLI Version: 3.20.0
- Nitro Version: 2.10.4
- Package Manager: npm@10.2.3
- Builder: -
- User Config: compatibilityDate, routeRules, devtools, sourcemap
- Runtime Modules: -
- Build Modules: -
Reproduction
https://stackblitz.com/edit/github-otbzpuzh
- Build the project using
npm run build - Inspect the
.nuxt/dist/server/_nuxt/spa.jsfile which includes the<TextEditor>component
Describe the bug
When setting ssr: false for specific routes in routeRules, the expected behavior is for these routes to be excluded from the server bundle and executed entirely on the client side. However, the routes are still bundled into the server, defeating the purpose of ssr: false. This forces the use of <ClientOnly> or similar workarounds, which is not desirable.
Additional context
My use case involves an SSR Nuxt app that includes a large number of /admin SPA pages. These routes are intended to run entirely on the client. While setting ssr: false for /admin/** routes works as expected in terms of rendering, Nuxt still includes all their code in the server bundle.
Currently, I am forced to wrap every SPA route's content in a <ClientOnly> component or use conditional checks like if (import.meta.client) for tree-shaking.
Also making page components as .client.vue didn't work for me
Logs