apollo icon indicating copy to clipboard operation
apollo copied to clipboard

$apollo and $apolloHelpers are unknown

Open ibockowsky opened this issue 1 year ago • 2 comments

Environment


  • Operating System: Darwin
  • Node Version: v20.9.0
  • Nuxt Version: 3.8.2
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

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

ibockowsky avatar Jan 03 '24 06:01 ibockowsky

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

const apolloc = useApolloClient();
const apollo = useApollo();

ehsanonline avatar Feb 09 '24 10:02 ehsanonline

@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.

nuraeil avatar Feb 09 '24 20:02 nuraeil