The string did not match the expected pattern
Hi, I'm trying tRPC out for the first time. Everything went very smooth up until trying to query something from my frontend (which is SvelteKit)
I get the error in image attached.
I am running the tRPC service locally, but tunneled through ngrok. This seemed to work when I tested it using Postman: it returned a value just as I expected, so the server is working.
I'm using node 20 - npm
tRPC version: 11.0.0-rc.477
Solution:Jump to solution
Well, I figured it out. Seems somehow ngrok was the problem anyway. Since HTML was being returned (the ngrok browser warning screen), the json deserialization was failing, resulting in this error.
To fix, I added the
ngrok-skip-browser-warning
header, which worked:
```ts
const trpc = createTRPCClient<AppRouter>({...1 Reply
Solution
Well, I figured it out. Seems somehow ngrok was the problem anyway. Since HTML was being returned (the ngrok browser warning screen), the json deserialization was failing, resulting in this error.
To fix, I added the
ngrok-skip-browser-warning
header, which worked: