icflorescu / trpc-sveltekit

End-to-end typesafe APIs with tRPC.io for your SvelteKit applications.

Home Page:https://icflorescu.github.io/trpc-sveltekit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolving conflict with trpc-sveltekit and [...rest] directory on the root route

amit13k opened this issue · comments

commented

I'm fairly new to SvelteKit, and I'm using trpc-sveltekit in my project. I've encountered a problem when trying to use a [...rest] directory on the root route. According to the documentation, trpc-sveltekit reserves the /trpc path prefix, which seems to conflict with the [...rest] directory.

As a result, I am getting an error like "No "query"-procedure on path" when using trpc-sveltekit alongside the [...rest] directory on the root route. I have tried matchers like [...rest=exclude_trpc] where exclude_trpc is a regex that matches everything except /trpc* but they don't seem to work. Any suggestions for how to resolve this issue?

Perhaps you could setup your own endpoint?

I wrote a lil guide: #87