apollo
apollo copied to clipboard
Can't use apollo composables when @vue/apollo-composable isn't directly inside node_modules
Environment
- Operating System:
Linux - Node Version:
v16.20.0 - Nuxt Version:
3.6.0 - Nitro Version:
- - Package Manager:
NPM - Builder:
webpack - User Config:
- - Runtime Modules:
- - Build Modules:
-
Describe the bug
using useLazyAsyncQuery or any of the other apollo composable but useAsyncQuery results in the following import bug
[plugin:vite:import-analysis] Failed to resolve import "@vue/apollo-composable" from "pages/sink.vue". Does the file exist?
Expected behaviour
I should be able to use the other composables according to the docs, right?
Reproduction
No response
Additional context
No response
Logs
No response
I have the same issue.
It was working fine until I installed GraphQL Code Generator..
This changed the dependency tree so that the @vue/apollo-composable package was no longer at ./node_modules/@vue/apollo-composable (where this package expects it to be) and was moved to ./node_modules/@nuxtjs/apollo/node_modules/@vue/apollo-composable.
This package needs to resolve the location of @vue/apollo-composable according to the node module resolution algorithm, instead of assuming it to be directly inside node_modules.
@oosame Could you maybe update the issue title to be more accurate? (Since sometimes you can use apollo composables). Something like "Can't use apollo composables when @vue/apollo-composable isn't directly inside node_modules?
@Diizzayy could you kindly give us a hand?
any updates on this? i have same error
@Diizzayy did you link this issue accidentally? This has nothing to do with reactivity or type hints and all to do with module resolution. Thanks!
@zenflow no, there have been slight changes which has thus far proven to fix this issue, hence why it has been closed until further notice ( will be revisited if needed )
Great news @Diizzayy thank you!!