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
Parametrized Hilla file route like frontend/views/products/{productId}.tsx shows "Could not navigate to 'products/1'" error page when navigating for example to /products/1 path with export const config: ViewConfig = { flowLayout: false }; in the tsx and project has Layout annotation to enable automatic flow layout for the route.
Maybe this has something to do in here in Hilla file-router. I noticed that in generated file-routes.ts all flowLayout flags are true for some reason. Tested to switch them to false in the generated file and that made view show up again. Could you check this out @caalador?
file-routes.ts gets true for all that have a possible layout (matching path in the layouts.json) and that true is overridden by the actual ViewConfig definition of the view.
One issue is that /products/:productId doesn't match /products/1 so we would need some template matching to the hasClientRoute check.
The client side also seems to be quite tightly tide to the parent flowLayout state instead of the child state, so that would probably need some logic update so a child with flowLayout false is not going to the server when the parent has flowLayout true.
Also mixed use layouts for instance "platform/hello" layout true and "platform/hilla" layout false woudl both use the layout that is in "platform" and not what they define.
Also on the file-routes.ts is you change only the createRoute("products", true, [ to createRoute("products", false, [ the parameterised route works, but not if you only change the child createRoute.
Description of the bug
Parametrized Hilla file route like
frontend/views/products/{productId}.tsx
shows "Could not navigate to 'products/1'" error page when navigating for example to/products/1
path withexport const config: ViewConfig = { flowLayout: false };
in the tsx and project hasLayout
annotation to enable automatic flow layout for the route.Expected behavior
Hilla view is shown without flow main layout.
Minimal reproducible example
Download my-app.zip, unpack and run it and navigate to http://localhost:8080/products/1
Versions
Hilla: 24.5.0.rc2
Flow: 24.5.0.rc2 / 24.5.0
Vaadin: 24.5.0.rc2
Copilot: 24.5.0.rc2
Frontend Hotswap: Enabled, using Vite
OS: amd64 Windows 10 10.0
Java: JetBrains s.r.o. 17.0.11
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Java Hotswap: Java Hotswap is enabled
IDE Plugin: 1.3.3 IntelliJ
The text was updated successfully, but these errors were encountered: