Closed kevcodez closed 1 month ago
Currently the bridge only supports nitro.routeRules
instead of routeRules
.
nitro: {
routeRules: {
"/test/**": { ssr: false },
"/test": { ssr: false },
},
},
This seems to be working. https://codesandbox.io/p/devbox/nuxt-bridge-forked-f47pjk
@wattanx you're a life saver, thanks!
Environment
Darwin
v20.17.0
2.18.1
3.13.2
2.9.6
npm@10.5.0
webpack
bridge
,ssr
,serverMiddleware
,modern
,telemetry
,components
,head
,loading
,router
,css
,plugins
,buildModules
,modules
,sitemap
,axios
,sentry
,build
,publicRuntimeConfig
,googleFonts
,watchers
,alias
,serverHandlers
,devServerHandlers
,devServer
,typescript
,nitro
@nuxtjs/axios@5.13.6
,@nuxtjs/sentry@8.0.8
,@nuxtjs/sitemap@2.4.0
,cookie-universal-nuxt@2.2.2
()
,~/modules/preload
,@nuxtjs/google-fonts@3.2.0
,@nuxt/bridge@3.3.1
Reproduction
Nuxt-Bridge Link: https://codesandbox.io/p/devbox/nuxt-bridge-forked-cp5gr5?workspaceId=30220bd5-c136-4f9b-95b9-4ccf2a841fd5
Nuxt 3 Link (this works as expected!): https://codesandbox.io/p/devbox/nuxt3-playground-forked-8rdmhh
Describe the bug
When using nested dynamic routes routes with nuxt-bridge + nitro and setting
ssr: false
in the routeRules, it seems like this is not properly respected. I managed to get the child page to only be rendered on the client, but the parent layout in the nested dynamic route would still be rendered on the server, causing rendering issues as my page does not support SSR.I have attached a reproduction link for both Nuxt-Bridge and Nuxt 3 - with Nuxt 3 everything works as expected and the page is only rendered on the client. In the Nuxt-Bridge example, the page is still rendered on the server (you can see the console logs in the Nuxt terminal logging
false
forprocess.client
that is logged within the pages indicating a server-side render.I would expect nuxt-bridge with Nitro to behave the same and fully respect the ssr setting from the routeRules and render this entire page (parent nested page + child page) on the client-side.
Additional context
No response
Logs
No response