Maven Error in QueryParametersModel when phase dev.hilla:hilla-maven-plugin:2.3.2:build-frontend

Hi folks,
I ran into a problem after upgrading to Hilla 2.3.2 when trying to build the application.

Build on macOS with , Node v20.9.0

The code that is thrown the error was generated by the hilla build chain.

  • Already deleted the complete “generated” folder in the frontend
  • Issue started after upgrade to Hilla 2.3.2 and a CI pipeline try’s to build the project
  • Locally I had a already persist node_modules folder inside of the project, I was able to build without any issue, then I removed to node_modules folder and the problem is present now on my local machine , too
  • There were no problems / issues reported while fetching the node modules / dependencies
[ERROR] vite v4.4.11 building for production...
[ERROR] transforming...
[ERROR] frontend/generated/com/vaadin/flow/router/QueryParametersModel.ts(6,9): error TS2322: Type 'ObjectModel<NonNullable<T["parameters"]>>' is not assignable to type 'ObjectModel<Record<string, readonly string[]>>'.
[ERROR]   Type 'NonNullable<T["parameters"]>' is not assignable to type 'Record<string, readonly string[]>'.
[ERROR]     'string' index signatures are incompatible.
[ERROR]       Type '(string | undefined)[] | undefined' is not assignable to type 'readonly string[]'.
[ERROR]         Type 'undefined' is not assignable to type 'readonly string[]'.
[ERROR] ✓ 521 modules transformed.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal dev.hilla:hilla-maven-plugin:2.3.2:build-frontend (default) on project FlowConnect: Execution default of goal dev.hilla:hilla-maven-plugin:2.3.2:build-frontend failed: Vite process exited with non-zero exit code.
Stderr: 'vite v4.4.11 building for production...
transforming...
frontend/generated/com/vaadin/flow/router/QueryParametersModel.ts(6,9): error TS2322: Type 'ObjectModel<NonNullable<T["parameters"]>>' is not assignable to type 'ObjectModel<Record<string, readonly string[]>>'.
  Type 'NonNullable<T["parameters"]>' is not assignable to type 'Record<string, readonly string[]>'.
    'string' index signatures are incompatible.
      Type '(string | undefined)[] | undefined' is not assignable to type 'readonly string[]'.
        Type 'undefined' is not assignable to type 'readonly string[]'.
✓ 521 modules transformed.
'

Things I noticed on build: The plugin names are different:

After Upgrade

INFO (tsgen): Plugins: d, e, m, p, m, SubTypesPlugin
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 169 resources. Took 258 ms.
[INFO] Running Vite ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

BEFORE Upgrade

INFO (tsgen): Output directory: /projectDir/frontend/generated
INFO (tsgen): Plugins: BackbonePlugin, ClientPlugin, BarrelPlugin, ModelPlugin, PushPlugin, SubTypesPlugin
INFO (tsgen) <BarrelPlugin>: Generating 'endpoints.ts' file
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 169 resources. Took 186 ms.
[INFO] Running Vite ...

Sounds like it might be related to this: https://github.com/vaadin/hilla/issues/1612

I wonder why it’s trying to genreate com/vaadin/flow/router/QueryParametersModel :thinking:

@secure-leopard How is the release cycle for the Hilla 2.3.x ? I will this on the next 2.3.x release. I thought that the QueryParametersModel files are always created by the generator or is there a trigger that will create this file only if needed ? As mention I already deleted all generated content and also tried it with the hilla:clean-frontend maven target. But all rebuilds run to the same errir

Are you using QueryParameters in your java code?

I rechecked and yes, I used it in a function that redirect a client to a location inside of the application, there I used the QueryParameters from package com.vaadin.flow.router.QueryParameters

That will likely trigger the generation of the QueryParametersModel

I can reproduce the issue and created a bug report on Github

https://github.com/vaadin/hilla/issues/1724