icflorescu/trpc-sveltekit

Route not found after deploying to another environment

Closed this issue · 1 comments

I recently added trpc-sveltekit to an existing project. After building the project, everything appears to work well locally (of course! lol)... however after deploying to a test environment, I start to see this error in the logs.

2022-12-07 22:33 +00:00: Error: Not found: /files.create
2022-12-07 22:33 +00:00:     at resolve (file:///local.path/build/server/index.js:2738:18)
2022-12-07 22:33 +00:00:     at resolve (file:///local.path/build/server/index.js:2761:34)
2022-12-07 22:33 +00:00:     at file:///local.path/node_modules/trpc-sveltekit/dist/server.js:29:16
2022-12-07 22:33 +00:00:     at Object.handle (file:///local.path/build/server/chunks/hooks.server-55dce63f.js:5110:26)
2022-12-07 22:33 +00:00:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-12-07 22:33 +00:00:     at async respond (file:///local.path/build/server/index.js:2759:22)
2022-12-07 22:33 +00:00:     at async Array.ssr (file:///local.path/build/handler.js:16060:3)

I see the browser attempting to make the request, which returns a 404.
https://testing.site/trpc/files.create?batch=1

This doesn't appear to be an issue of it working in dev mode but not after a build since I can run the build locally just fine. Most likely an environment configuration issue... maybe something is locked down tighter on the test environment, etc. But when it comes to tRPC, I'm not sure what to look for.

I was able to identify the issue. An incorrect proxy server setting was the culprit... causing the /trpc/* paths specifically to fail.