Vite does not work with custom frontend directory #14046
Labels
bug
Impact: Low
prerelease version for Vaadin 23.2.0
Released with Vaadin 23.1.6
Released with Vaadin 23.2.0.beta1
Severity: Major
vite
Tickets related to vite support
Description of the bug
When using Vite is a Spring Boot project with a custom frontend folder configured in
vaadin-maven-plugin
, the dev server seems to start, but the java application keeps restarting infinitely.Main problem seems to be that in
vite.generated.ts
there aroot
key whose value is hard-coded to 'frontend'.This can be fixed in
vite.config.ts
But then there are failure in themes compilation, because they are still using
frontend/generated
directory instead to be nested into the custom frontend folder.The workaround for this is to set also the
generatedTsFolder
setting invaadin-maven-plugin
, pointing to a subfolder of the custom generated frontend dir.However this does not make Vite work because there are other issues with custom frontend folder.
This is slightly related to #12880).
For example some hard-coded relative path that assumes files are in
frontend/generated
(for example../../target/xyz
).Additional note: vite.generated.ts has the following confiuration that may also be wrong with custom frontend directory
Minimal reproducible example
Download an application from start.vaadin.com with Vite enabled and add the following configuration to
vaadin-maven-plugin
.Expected behavior
Vite dev serve works as when using default
frontend
directoryActual behavior
Versions:
The text was updated successfully, but these errors were encountered: