-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useAsyncData Does Not Work Server-Side In Dev Mode #318
Comments
Also seeing this |
1 similar comment
Also seeing this |
Is this a client side or server side issue? In the text above you say it doesn't work server side, but in the title you say it doesn't work client side. I'm currently having similar issues when using GqlXXX-functions upon initial load (so server side). Everything seems to work client side; I can inject the Gql-functions through HMR by commenting them out, refreshing the page, and then uncommenting them. It also works in production (npm run build && npm run preview) as expected. |
My bad, thanks for pointing it out. It's a server-side issue. Like you said, on initial load the data is not there. |
@buffalom This issue should be fixed in the latest version (0.2.27). |
@Diizzayy I'm still seeing this issue in 0.2.27 |
I had issues after upgrading the package. However, after deleting |
Seems to be working just fine for me. Thanks a bunch for fixing this so quickly. |
I have the error again for nuxt 3.4.3 and the version 0.2.27. This is the component:
The outputted error is:
If I use the same component but add:
the data appears. Any ideas why this is happening? |
Environment
Linux
v16.14.2
3.2.3
2.2.3
npm@7.17.0
vite
modules
,runtimeConfig
nuxt-graphql-client@0.2.25
-
Darwin
v18.13.0
3.2.3
2.2.3
yarn@1.22.17
vite
runtimeConfig
,modules
nuxt-graphql-client@0.2.25
-
Describe the bug
I have a freshly installed Nuxt 3 app with the nuxt-graphql-client module. However, all the nuxt-graphql-client function (namely useAsyncData and GqlXXX()) don't seem to work server-side in dev mode. They don't throw an error, but they just return null as the data. If the files are saved and the app is hot-reloaded, the request is made client-side and the data is returned as expected.
As soon as the app is built for production (using
yarn build
) the function also work server-side.Expected behaviour
There should not be a difference from the dev mode to the prod build. The data should also be present server-side in dev mode.
Reproduction
https://stackblitz.com/edit/github-stxa8b?file=app.vue
Additional context
Demo video on Stackblitz
I have the same issue on Stackblitz as well as locally on my M1 MacBook (demo video).
Let me know if you need more context. If it is my fault and I am doing something wrong, please let me know. I would love your help.
Logs
No response
The text was updated successfully, but these errors were encountered: