nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
955 stars 198 forks source link

$apollo and $apolloHelpers are unknown #588

Closed ibockowsky closed 8 months ago

ibockowsky commented 10 months ago

Environment


Describe the bug

image

It should be typed correctly

Expected behaviour

Type should be known

Reproduction

https://github.com/ibockowsky/nuxt3-apollo-undefined-reproduction

Additional context

No response

Logs

No response

ehsanonline commented 9 months ago

I'm having the same problem with Bun and Nuxt 3.10, a workaround is:

const apolloc = useApolloClient();
const apollo = useApollo();
nuraeil commented 9 months ago

@ehsanonline @ibockowsky Are you using bundler as resolution in typescript\tsConfig\compilerOptions inside of nuxt.config.ts or as of 3.10 natively via. Nuxt?

If so, it might be related to this one: https://github.com/nuxt-modules/apollo/issues/593

Try turning off bundler resolution.