Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing hints for automatic menus #20458

Closed
mshabarov opened this issue Nov 13, 2024 · 1 comment · Fixed by #20476
Closed

Missing hints for automatic menus #20458

mshabarov opened this issue Nov 13, 2024 · 1 comment · Fixed by #20476
Assignees
Labels
bug Impact: Low native-image Issues related to native image compilation, GraalVM Severity: Major

Comments

@mshabarov
Copy link
Contributor

mshabarov commented Nov 13, 2024

Description of the bug

@marcushellberg :
I'm getting this when trying to run an app as a GraalVM native image. I can't reproduce it in a simple app, so I haven't yet filed an issue. Any pointers on what may be going wrong? Looks like we may be missing some hints again

2024-11-02T17:44:57.084-04:00  WARN 61021 --- [nps] [           main] c.v.flow.internal.menu.MenuRegistry      : Failed load file-routes.json from /META-INF/VAADIN/file-routes.json

com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.vaadin.flow.server.menu.RouteParamType` from String "req": not one of the values accepted for Enum class: [OPTIONAL, WILDCARD, REQUIRED]
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 10, column: 21] (through reference chain: java.util.ArrayList[0]->com.vaadin.flow.server.menu.AvailableViewInfo["children"]->java.util.ArrayList[0]->com.vaadin.flow.server.menu.AvailableViewInfo["params"]->java.util.LinkedHashMap[":token"])

Expected behavior

No warnings and errors.

Minimal reproducible example

No info, but probably Vaadin 24.6 application that uses FS router and auto menus feature, also compiled to GraalVM native image.

Versions

Vaadin 24.6 pre

@mcollovati
Copy link
Collaborator

mcollovati commented Nov 14, 2024

It can be reproduced with the flow-hilla-hybrid-example, by adding an optional parameter view route.
For example, create a src/main/frontend/views/products/{{product}}.tsx file with the following content

import { useParams } from 'react-router-dom';
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js";

export const config: ViewConfig = {
    loginRequired: false,
    menu: {
        title: "Product",
        icon: 'vaadin:info'
    }
};

export default function ProductView() {
    const { productId } = useParams();

    return (<>
        <span>{productId}</span>
    </>)
}

Then build the native executable with mvn -Pproduction -Pnative native:compile
When starting the application, you should see the error.

mcollovati added a commit that referenced this issue Nov 14, 2024
@mcollovati mcollovati moved this from ⚒️ In progress to 🔎Iteration reviews in Vaadin Flow ongoing work (Vaadin 10+) Nov 14, 2024
@github-project-automation github-project-automation bot moved this from 🔎Iteration reviews to Done in Vaadin Flow ongoing work (Vaadin 10+) Nov 14, 2024
vaadin-bot added a commit that referenced this issue Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: Low native-image Issues related to native image compilation, GraalVM Severity: Major
Projects
Development

Successfully merging a pull request may close this issue.

2 participants