hilla
hilla copied to clipboard
Menu route items are not visible
Describe the bug
An example project from Copilot and a project downloaded from start do not have any route items in Drawer However frontend/generated/file-routes.ts has the route definitions. Additionally, routes are visible on flow projects.
import type { AgnosticRoute } from "@vaadin/hilla-file-router/types.js";
import { createRoute } from "@vaadin/hilla-file-router/runtime.js";
import * as Page0 from "../views/@index.js";
import * as Page1 from "../views/hello-world.js";
import * as Layout2 from "../views/@layout.js";
const routes: readonly AgnosticRoute[] = [createRoute("", Layout2, [createRoute("", Page0), createRoute("hello-world", Page1)])];
export default routes;
Expected-behavior
Routes should be rendered in Sidenav properly.
Reproduction
Download a project from start.vaadin.com or open the project.
System Info
Vaadin version: 24..5-SNAPSHOT OS: MacOS 14.4.1 (23E224)
This is probably because 24.5-SNAPSHOT downgrades hilla npm dependencies from 24.4 beta2 to 24.4 beta1
Just a side note:
Apart from what the actual cause of this issue is, the menus are populated based on the value of the window.Vaadin.views global object, that in turn is being initialized based on the entries of file-routes.json not the file-routes.ts. However, when there are proper routes imported in the file-routes.ts, it can be assumed that the proper values are also present in the file-routes.json.
Hi @abdullahtellioglu,
I gave your attached application a try with beta3 and couldn't reproduce the issue, the output looks like this:
Is this still an issue for you or could we close it?
I cannot reproduce it either. Closing the issue as completed 👍 Thanks @taefi