-
TLDR: The host needs to be an absolute URL. i.e Hey there 👋. I'm running into a problem with server-side requests and I not sure how to continue debugging the issue. I have a <script setup lang="ts">
let { data } = await useAsyncData('organizations', async () => {
try {
return await GqlOrganizations();
} catch (err) {
console.log(err)
}
});
</script> which throws this error: {
client: 'default',
operationType: 'query',
operationName: 'Organizations',
statusCode: undefined,
gqlErrors: undefined
} If I make the call without the wrapped async function if (process.server) {
await GqlOrganizations()
} I get the following error: [Vue warn]: Unhandled error during execution of setup function
at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > key="/" >
[nuxt] [request error] [object Object]
[Vue warn]: Invalid prop: type check failed for prop "statusCode". Expected String with value "500", got Number with value 500.
[nitro] Error while generating error response FetchError: 302 (/__nuxt_error?url=/&statusCode=500&statusMessage=Internal+Server+Error&message=[object+Object]&description=%3Cpre%3E%3C/pre%3E&data)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.errorhandler [as onError] (.nuxt/dev/index.mjs:312:16)
at async Server.nodeHandler (/node_modules/h3/dist/index.mjs:373:9) Any calls made from the browser work great: if (process.client) {
await GqlOrganizations()
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@jvanst Thank you for bringing forth this issue, my first assumption was that the server side authentication was failing but that is unlikely. Would you be able to provide a basic reproduction or give me access to the api so that I can further investigate the underlying cause here? I haven't been able to recreate this behavior locally |
Beta Was this translation helpful? Give feedback.
@jvanst Thank you for bringing forth this issue, my first assumption was that the server side authentication was failing but that is unlikely.
Would you be able to provide a basic reproduction or give me access to the api so that I can further investigate the underlying cause here? I haven't been able to recreate this behavior locally