TypeError: fetch failed
I’m getting this error when trying to use server-side rendering with preloadQuery:
Failed to run onboarding logic: TypeError: fetch failed
This happens when running Node.js 22 on Linux. Previously, the workaround was to revert back to Node 18, which resolved the issue.
However, after upgrading to Next.js 16, which now requires Node 20+, reverting to Node 18 is no longer an option.
So at the moment, it seems that developing on Linux with a Convex backend breaks when using the latest Next.js version, since Node 22 triggers the fetch failed error.
Question:
Is there a known fix or recommended workaround for this issue on Linux environments using Node 20+?
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
That error would be from your own application code - if this error is coming from Nextjs and only happens when Next is running on a specific version of Node, you'll want to look for an assist in the Next community.
This is an issue for many people on windows, I'd use node 23+ as it was the node version it worked for most people as node 18 is deprecated