Gwendal
Gwendal8mo ago

"Failed to load response data: No data found for resource with given identifier" in the network tab

I started a new project, but I can't read the results from my queries in the network tab on my browser. This makes the developer experience (DX) poor since I can't see my query calls. Sometimes (around 20% of the time) it works on Safari, but the JSON formatting looks off (see screenshot). It never works on Chrome. What's strange is that the queries are fetched properly and when I log the query results in my console in my Next.js app, I can clearly see them. I'm using Next.js with the app router. You can replicate this using the standard create-t3-app. Has anyone else faced this issue? "dependencies": { "@prisma/client": "^5.14.0", "@t3-oss/env-nextjs": "^0.10.1", "@tanstack/react-query": "^5.50.0", "@trpc/client": "^11.0.0-rc.446", "@trpc/react-query": "^11.0.0-rc.446", "@trpc/server": "^11.0.0-rc.446", "geist": "^1.3.0", "next": "^14.2.4", "react": "^18.3.1", "react-dom": "^18.3.1", "server-only": "^0.0.1", "superjson": "^2.2.1", "zod": "^3.23.3" },
No description
No description
No description
3 Replies
hiradsab
hiradsab4mo ago
Running into this issue as well. @Gwendal did you find a fix for this?
Quan Tran
Quan Tran4mo ago
I also got this issue, but don't know how to fix it. But the response seem still working okie at code.
Jordy
Jordy2w ago
Came here from Google, researching the same problem. The problem seems to happen when using httpBatchStreamLink, not when using httpBatchLink or httpLink. Also, in my case, only happens on production environments, not localhost (using tanstack start). Still figuring out what's causing it When you take the request URL and open it in a seperate tab, it shows the response. It works fine when inspecting in Firefox Dev Tools. So I think this is bugging out only in Chrome (and Safari) Dev Tools. The data is showing (and streaming in) just fine in my app, but really annoyying it comes with the cost of not having a easy way to debug responses through Chrome Dev Tools. Which makes me want to not use httpBatchStreamLink. As a workaround, adding a header override in Chrome Dev Tools, something like "x-someting": "something", will magically always show the responses now. Also noticed the docs say: Cause the response to be sent with a transfer-encoding: chunked and content-type: application/jsonl https://trpc.io/docs/client/links/httpBatchStreamLink#streaming-mode However, the response does nót return application/jsonl but just application/json : https://github.com/trpc/trpc/blob/93403aa91a838af1cc645193b106c870654664f2/packages/server/src/unstable-core-do-not-import/http/resolveResponse.ts#L507 Maybe that's the issue? And maybe it should include a charset in the response too, as mentioned here? https://github.com/wardi/jsonlines/issues/19#issuecomment-2698043153

Did you find this page helpful?