-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Labels
Description
Environment
- Operating System:
Linux - Node Version:
v22.11.0 - Nuxt Version:
3.15.4 - CLI Version:
3.22.5 - Nitro Version:
2.11.5 - Package Manager:
[email protected] - Builder:
- - User Config:
$development,$production,compatibilityDate,app,logLevel,srcDir,devServer,devtools,sourcemap,modules,auth,unleash,analytics,css,eslint,stylelint,nitro,googleFonts,imports,pinia,lodash,fetch,jsonapi,apollo,runtimeConfig,vite,tailwindcss,primevue,svgo,typescript,proxy,sentry - Runtime Modules:
[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@pinia/[email protected],[email protected],@primevue/[email protected],~/modules/fetch,@shared/[email protected],~/modules/auth,@shared/[email protected],@shared/[email protected],@vee-validate/[email protected],@nuxt/[email protected],@nuxt-alt/[email protected],@sentry/nuxt/[email protected],@nuxtjs/[email protected] - Build Modules:
-
Describe the bug
When passing server: false to useAsyncQuery (internally to useAsyncData), the Apollo client query still executes on server-side (SSR).
Looking at composables.ts, the fn doesn't check import.meta.server, which causes this option to be ignored.
Expected behaviour
Setting server: false should skip the query execution during SSR and only run it on client-side.
Reproduction
// Example composable usage
const { result } = useAsyncQuery({
query: MY_QUERY,
variables: {},
server: false
})This triggers a request during SSR. It should not.
Additional context
Related issues: