Which project does this relate to?
Router
Describe the bug
Code that worked in router-cli@1.166.30 and below
const routeVarOfferDefinition = `/offers` as const;
const routeApi = getRouteApi(
`/$locale/_main/(offers)${routeVarOfferDefinition}/$actionId/$tab`,
);
export const Route = createFileRoute(
`/$locale/_main/(offers)${routeVarOfferDefinition}/$actionId/$tab`,
)({
now in 1.166.31+ throws this error during route generation
Error: Error transforming route file /front/spa/src/routes/$locale/_main/(offers)/-offer/$actionId/$tab.tsx:
Error: expected route id to be a string literal or plain template literal in /$locale/_main/(offers)/offers/$actionId/$tab
We were relying heavily on semi dynamic URLs (we generate routeVarOfferDefinition like consts during prepare step before TanStack Router kicks in) and actually the error implies that it should work but does not.
I guess this PR is to blame
#7167
Your Example Website or App
https://stackblitz.com/edit/github-t8vtvecd?file=src%2Froutes%2Fabout.tsx,package.json
Steps to Reproduce the Bug or Issue
- Go to https://stackblitz.com/edit/github-t8vtvecd?file=src%2Froutes%2Fabout.tsx,package.json
- Ctrl + c in terminal
tsr generate -> all good
- update version to 1.166.31
- npm install
tsr generate fails with expected route id to be a string literal or plain template literal as About page has dynamic part.
Expected behavior
I would expect it to continute working. One of the best Tanstack Router features for our platform as we need to support deep variations for different markets.
Screenshots or Videos
No response
Platform
@tanstack/router-cli@1.166.30
Additional context
No response
Which project does this relate to?
Router
Describe the bug
Code that worked in router-cli@1.166.30 and below
now in 1.166.31+ throws this error during route generation
We were relying heavily on semi dynamic URLs (we generate
routeVarOfferDefinitionlike consts during prepare step before TanStack Router kicks in) and actually the error implies that it should work but does not.I guess this PR is to blame
#7167
Your Example Website or App
https://stackblitz.com/edit/github-t8vtvecd?file=src%2Froutes%2Fabout.tsx,package.json
Steps to Reproduce the Bug or Issue
tsr generate-> all goodtsr generatefails withexpected route id to be a string literal or plain template literalasAboutpage has dynamic part.Expected behavior
I would expect it to continute working. One of the best Tanstack Router features for our platform as we need to support deep variations for different markets.
Screenshots or Videos
No response
Platform
@tanstack/router-cli@1.166.30
Additional context
No response