You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug Report: Paraglide i18n Broken Since v1.141.2 #6089
#5317 - fix: prevent HMR to throw error about entrypoints [merged] #5344 - examples: fix paraglide start example [merged] #5487 - examples: fix paraglide start link example [merged] #5647 - test(solid-start): fix dev server for suspense transition [merged] #5844 - docs(solid-router): i18n paraglide example [merged]
Also seeing this issue. Seems like if the incoming request has an empty query param like ?utm_content=&utm_source=something then we get the infinite redirect.
Does not happen with local dev server or with local node js preview build.
TypeError: Cannot read private member #state from an object whose class did not declare it
at get referrer (node:internal/deps/undici/undici:10694:18)
at Object.RequestInit (node:internal/deps/undici/undici:4568:35)
at new Request (node:internal/deps/undici/undici:10404:34)
at new Request$1 (file:///.../start-i18n-paraglide/node_modules/h3-v2/node_modules/srvx/dist/adapters/node.mjs:112:4)
at paraglideMiddleware (/.../start-i18n-paraglide/src/paraglide/server.js:105:11)
at async file:///.../start-i18n-paraglide/node_modules/@tanstack/start-plugin-core/dist/esm/dev-server-plugin/plugin.js:64:30
I ran PR #6072 through Codex with access to Paraglide's source code.
The most likely regression is in Paraglide’s server middleware
request cloning: it currently (pre-fix) constructs the “next”
request with new Request(url, request) (i.e. passing a Request
object as RequestInit). In runtimes that mix multiple Request
implementations (notably undici + h3/srvx/nitro wrappers),
undici will try to read private fields from that “init” object
and crash with errors like Cannot read private member #state… —
and depending on how the framework handles that failure, it can
surface as redirect loops / ERR_TOO_MANY_REDIRECT.
This is the line of code in the server middleware.
? newRequest(runtime.deLocalizeUrl(request.url),request)
: // need to create a new request object because some metaframeworks (nextjs!) throw otherwise// https://github.com/opral/inlang-paraglide-js/issues/411newRequest(request);
Can someone try to add a try catch around the paraglide middleware/tanstack's server middleware to see if Codex assumption that ERR_TOO_MANY_REDIRECT is caused by an internal throw that isn't surfaced is true?
This is the same behavior from Paraglide in both versions of Tanstack start.
In older versions the server handler.fetch didn't redirect so many redirects didn't occur
For what it's worth, I'm getting a similar error after updating to the latest versions of Tanstack Start and Router, and I'm not using Paragilde. For me it's the clerkMiddleware, when it calls new Request, undici throws. I can't even console.log the args.request in the clerkMiddleware function without undici complaining.
I was able to reproduce my error by starting a new Tanstack Start project and adding this start.ts-file, with the start and router libraries set at 1.141.8. Another project with the same files, but with the very latest versions (1.142.7) instead, works. And from what I can see my main project also works after updating to 1.142.7.
Activity
coderabbitai commentedon Dec 13, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Possible Duplicates
🔗 Related PRs
#5317 - fix: prevent HMR to throw error about entrypoints [merged]
#5344 - examples: fix paraglide start example [merged]
#5487 - examples: fix paraglide start link example [merged]
#5647 - test(solid-start): fix dev server for suspense transition [merged]
#5844 - docs(solid-router): i18n paraglide example [merged]
👤 Suggested Assignees
🧪 Issue enrichment is currently in early access.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:mustafa-barakat commentedon Dec 13, 2025
This happens after build too with nitro.
When not using urlPatterns config and cookie strategy, it works only with baseLocale, otherwise many redirects too with any language.
I think this is related to #6072
EthanShoeDev commentedon Dec 17, 2025
Also seeing this issue. Seems like if the incoming request has an empty query param like
?utm_content=&utm_source=somethingthen we get the infinite redirect.Does not happen with local dev server or with local node js preview build.
It only fails with deployed nitro lambda build.
MathieuDoyon commentedon Dec 18, 2025
Removing the
urlstrategy stop making the crash. but now I'm losing the language defined in the url first path segment when the cookie is missingwith
urlstrategy, my error ismustafa-barakat commentedon Dec 19, 2025
With these packages
Strategies
strategy: ["url", "cookie", "preferredLanguage", "baseLocale"]Switching the server.ts to
Seems to fix the issue but may introduce other problems.
samuelstroschein commentedon Dec 19, 2025
Paraglide JS maintainer here.
I ran PR #6072 through Codex with access to Paraglide's source code.
This is the line of code in the server middleware.
Given that
new Request(input, options)is plain JS, undici should support it https://developer.mozilla.org/en-US/docs/Web/API/Request/Request.Can someone try to add a try catch around the paraglide middleware/tanstack's server middleware to see if Codex assumption that
ERR_TOO_MANY_REDIRECTis caused by an internal throw that isn't surfaced is true?mustafa-barakat commentedon Dec 20, 2025
@samuelstroschein
Both requests are of the same type but paraglide requests results to redirect to / which was already redirected to /en before, so it goes in a loop.
@MathieuDoyon How did you get your error?
Please Notice this my router.tsx
Original Incoming Request
Paraglide Request Result
This is the same behavior from Paraglide in both versions of Tanstack start.
In older versions the server handler.fetch didn't redirect so many redirects didn't occur
DennisJosefsson commentedon Dec 20, 2025
For what it's worth, I'm getting a similar error after updating to the latest versions of Tanstack Start and Router, and I'm not using Paragilde. For me it's the clerkMiddleware, when it calls new Request, undici throws. I can't even console.log the args.request in the clerkMiddleware function without undici complaining.
EthanShoeDev commentedon Dec 20, 2025
@DennisJosefsson I also hit this on the newest versions. I am also not using paraglide
schiller-manuel commentedon Dec 21, 2025
@EthanShoeDev what are you using? also clerk?
DennisJosefsson commentedon Dec 21, 2025
I was able to reproduce my error by starting a new Tanstack Start project and adding this
start.ts-file, with the start and router libraries set at 1.141.8. Another project with the same files, but with the very latest versions (1.142.7) instead, works. And from what I can see my main project also works after updating to 1.142.7.iktakahiro commentedon Jan 4, 2026
Hi, I opened generaltranslation/paraglide-js#573 and submitted a defensive fix (generaltranslation/paraglide-js#574). The issue still exists in v1.145.3 - new Request(request) fails because undici can't access private #state fields from TanStack's custom Request wrapper. Is this expected to be fixed on the TanStack side? @schiller-manuel
schiller-manuel commentedon Jan 4, 2026
tanstack start does not wrap request. this must be coming from srvx
cc @pi0
pi0 commentedon Jan 5, 2026
@schiller-manuel if you have upgraded srvx to 0.10 (it is a breaking change) please read notes to apply: https://github.com/h3js/srvx/releases/tag/v0.10.0
fix: address infinite redirect issue with latest tanstack start
deps: update @inlang/paraglide-js to v2.7.2 (#34)