Closed BorisKamp closed 8 months ago
Same issue here, as soon as I make reference to the useMutation, useSubscription, or useQuery composables.
useAsyncQuery and useLazyAsyncQuery composables do not do this.
Since it seems to be an issue with the auto import, any reference is enough to make it bail like this for me.
<script setup lang="ts">
useMutation;
</script>
<template></template>
ERROR Internal server error: Failed to resolve import "@vue/apollo-composable" from "pages/centres/[id]/edit.vue". Does the file exist?
Plugin: vite:import-analysis
10 | import { gql } from 'graphql-tag';
11 | import { useAsyncQuery } from '/Volumes/(snip)/nuxt-test/node_modules/@nuxtjs/apollo/dist/runtime/composables';
12 | import { useMutation } from '@vue/apollo-composable';
| ^
13 | /* Injection by vite-plugin-vue-inspector Start */
14 | import { createVNode as __createVNode,createElementVNode as __createElementVNode,createElementBlock as __createElementBlock } from 'vue'
12 │ "devDependencies": {
13 │ "@nuxt/devtools": "^1.0.0-beta.2",
14 │ "@nuxtjs/apollo": "^5.0.0-alpha.7",
15 │ "nuxt": "^3.7.4",
16 │ "vue": "^3.3.4",
17 │ "vue-router": "^4.2.5"
18 │ },
I could get past this by installing "@vue/apollo-composable" manually, but hitting other issues also mentioned in #550.
I got rid of this package and moved to https://github.com/Diizzayy/nuxt-graphql-client
And I must say it was very easy to setup and use, wish I found this earlier.
@pat-flew did you find a solution for this ?
Hopefully; the later suggestion in https://github.com/nuxt-modules/apollo/issues/550#issuecomment-1775884358 has been working for me so far @PierreCavalet
@BorisKamp: I tried the same and then i was realizing that the nuxt-graphql-client(https://github.com/jasonkuhrt/graphql-request#why-was-the-file-upload-feature-taken-away-will-it-return) removed the support of file uploads :( And now i am stucked :D How did u solve this? Or do u have no need of file uploads?
Environment
Darwin
v20.4.0
3.7.4
3.9.0
2.6.3
npm@9.7.2
-
runtimeConfig
,devtools
,nitro
,build
,css
,modules
,components
,googleFonts
,pwa
,i18n
,apollo
,image
@nuxtjs/google-fonts@3.0.2
,@kevinmarrec/nuxt-pwa@0.17.0
,@nuxtjs/i18n@8.0.0-rc.5
,@nuxtjs/apollo@5.0.0-alpha.7
,@nuxt/image-edge@1.0.0-rc.3-28294196.0bd6b68
,@nuxtjs/tailwindcss@6.8.0
,@pinia/nuxt@0.4.11
-
Describe the bug
I literally have no clue why this jumped in my screen at once. It was working before. I am calling a mutation as follows:
In my
<script lang="ts" setup>
.It gives me the following error in my console:
Expected behaviour
To just work like it did before....
Reproduction
No response
Additional context
No response
Logs
No response