Closed zto-sbenning closed 3 months ago
Hi @zto-sbenning,
I dont think that generateStaticParams
has any effect on this neither multiple dynamic parameters as I am doing the same forblogs/[author]/[article]
route in https://github.com/svobik7/next-roots/blob/master/examples/basic/src/routes/blogs/%5Bauthor%5D/%5Barticle%5D/page.tsx
☝️The only difference I can see is that you are using new Router(schema)
multiple times while I have that instantiated only once (see https://github.com/svobik7/next-roots/blob/master/examples/basic/src/server/router/index.ts#L20). Not sure if that can be the issue but it is the difference I can spot right now.
Please try to adjust the code accordingly and if it does not help please create some minimal repro repo.
Hi @zto-sbenning have you solved your issue? Could you please leave a short feedback for others if so? Thank you.
@svobik7 Sorry for the delay. It was indeed an issue with next caching the previous schema.
TY a lot!
Context:
roots.config.js
contentFolder structure
src/roots/hub/i18n.ts
contentProblem:
In
src/roots/hub/page.tsx
if I do:The
href
returned is"/chercher-un-salon/toto"
witch is all right.But in
src/roots/hub/[country]/page.tsx
if I do:The returned
href
is"/"
instead of"/chercher-un-salon/toto/tata"
.The same problem arrises for the route names
"/hub/[coutrny]/[department]/[city]"
and"/hub/[coutrny]/[department]/[city]/[district]"
.I do not use any
generateStaticParams
as I don't want all the possible pages to be generated at build time (can this be the source of the issue ?). I use typescript and the twogetHref
statement are valids in types (I ran thenpx next-roots
beforehand).Do you know why the
href
is not being computed correctly when there is more than 1 dynamic parameter ? Do you need a reproduction repo to investigate, or do you spot something I'm doing wrong ?Thank you in advance for any tips you can have !