Environment
nitro: latest
node: 24
Reproduction
https://stackblitz.com/edit/nitrojs-starter-jczkd8ob?file=vite.config.ts
You'll see the infinite redirect happen when clicking the increment button.
Describe the bug
When configuring nitro/vite to serve from a baseUrl and a call is made to a nested tRPC proc an infinite redirect happens.
Nested tRPC procs craft a url with a . in it, e.g. /trpc/nestedProc.get. I think when the url contains this character, the code introduced in #3817 is hit making nitro think the request is for a static asset. This only seems to happen when baseURL is configured however.
A workaround we've found is to prefix the nested procedure with a character (_ works) that breaks the regex above:
export const router = createTRPCRouter({
nestedProc: {
_get: get,
},
});
Additional context
No response
Logs
Environment
nitro: latest
node: 24
Reproduction
https://stackblitz.com/edit/nitrojs-starter-jczkd8ob?file=vite.config.ts
You'll see the infinite redirect happen when clicking the increment button.
Describe the bug
When configuring nitro/vite to serve from a baseUrl and a call is made to a nested tRPC proc an infinite redirect happens.
Nested tRPC procs craft a url with a
.in it, e.g./trpc/nestedProc.get. I think when the url contains this character, the code introduced in #3817 is hit making nitro think the request is for a static asset. This only seems to happen whenbaseURLis configured however.A workaround we've found is to prefix the nested procedure with a character (
_works) that breaks the regex above:Additional context
No response
Logs