Issue with Vaadin Flow to Hilla Migration: Cannot find module 'Frontend/generate

Hello,

I’ve started migrating a Vaadin Flow project to Hilla, currently using version 24.5.3. I’m using a Flow layout and migrating views progressively from Flow to Hilla. Locally, everything is working perfectly.

However, in the Github CI environment, when I run the command mvn install -Pproduction, I encounter the following error during the goal com.vaadin:vaadin-maven-plugin:24.5.3:build-frontend:

76206 [ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.5.3:build-frontend (default) on project backoffice: Execution default of goal com.vaadin:vaadin-maven-plugin:24.5.3:build-frontend failed: Vite process exited with non-zero exit code.
76206 [ERROR] Stderr: 'vite v5.4.9 building for production...
76206 [ERROR] transforming...
76206 [ERROR] frontend/generated/routes.tsx(37,24): error TS2307: Cannot find module 'Frontend/generated/file-routes' or its corresponding type declarations.

I’m stuck and can’t seem to find a solution. Has anyone encountered this issue before or could offer some guidance?

Thanks in advance!

We had an issue while building production in CI when migrating to a new version. Was fixed by clearing the hole CI workspace. I do not know if Github CI caches the build workspace.

Does the production build works locally?

Actually, I figured out how to fix the issue.

I realized that I missed an important configuration step because I hadn’t set up the vaadin-maven-plugin with the prepare-frontend goal by default:

<build>
    <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>${vaadin.version}</version>
        <executions>
            <execution>
                <goals>
                    <goal>prepare-frontend</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</build>

It worked fine locally because I had an active “local” profile that handled the frontend preparation step correctly.

Everything is working perfectly now. Thanks!

4 Likes