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
{{ message }}
Repository navigation
build-frontend execution should not be overridden on server run #13349
If configuring a project to execute prepare-frontend and build-frontend to generate a production build the application will fail to run correctly when executing mvn jetty:run or mvn spring-boot:run.
This is due to the fact that the run target will after the normal build also invoke the execution of the lifecycle phase test-compile prior to executing leading to prepare-frontend running a second time overriding the flow-build-info.json from the build-frontend execution.
In the starter projects this has been circumvented by running both goals in the compile phase.
prepare-frontend is not executed alone or a second time, overriding the flow-build-info.json and making the production build start the dev server.
Minimal reproducible example
Get a HelloWorld application from start and remove the <phase>compile</phase> from the production profile in the pom.
Run project with mvn spring-boot:run -Pproduction
Check that target\classes\META-INF\VAADIN\config\flow-build-info.json doesn't contain fallback modules and that target\frontend\generated-flow-imports.js doesn't contain all components while target\frontend\generated-flow-imports-fallback.js exists.
For a visual example:
Get a HelloWorld application from start and remove the <phase>compile</phase> from the production profile in the pom.
change the TextField name into Component name and initialize it in the as name = (Component)Class.forName("com.vaadin.flow.component.textfield.TextField").newInstance(); and remove notification show.
Run project with mvn spring-boot:run -Pproduction
See that text field is not rendered
Versions
Vaadin / Flow version: 14+
Application Server (if applicable): maven server plugin for jetty + spring-boot
Activity
fix: change build-frontend goal phase
fix: change build-frontend goal phase (#13360)
fix: change build-frontend goal phase (#13360)
fix: change build-frontend goal phase (#13360)
fix: change build-frontend goal phase (#13360) (#13376)
fix: change build-frontend goal phase (#13360) (#13375)
vaadin-bot commentedon Apr 5, 2022
This ticket/PR has been released with Vaadin 22.0.12.
vaadin-bot commentedon Apr 5, 2022
This ticket/PR has been released with Vaadin 23.0.4.