Getting started with Vaadin 24.5.0.beta5

1st tried to upgrade my main project. That failed at startup at building frontend:

09:31:49,818 DEBUG [com.ptsmc.vaadin.ServiceListener] (default task-2) sessionInit
09:31:49,820 ERROR [com.ptsmc.vaadin.CustomErrorHandler] (default task-2) Logged error: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\DeveloperArea\dawinci-main\vaadin-upgrade\ptsmc-widgetset\src\main\frontend` directory tree:
      - leaflet/dist/leaflet.css
  Check that they exist or are installed. If you use a custom directory for your resource files instead of the default `frontend` folder then make sure it's correctly configured (e.g. set 'vaadin.frontend.frontend.folder' property)


	at deployment.ptsmc.ear//com.vaadin.flow.server.frontend.AbstractUpdateImports.getCssLines(AbstractUpdateImports.java:502)
	at deployment.ptsmc.ear//com.vaadin.flow.server.frontend.AbstractUpdateImports.process(AbstractUpdateImports.java:376)
	at deployment.ptsmc.ear//com.vaadin.flow.server.frontend.AbstractUpdateImports.run(AbstractUpdateImports.java:161)
	at deployment.ptsmc.ear//com.vaadin.flow.server.frontend.TaskUpdateImports.execute(TaskUpdateImports.java:80)
	at deployment.ptsmc.ear//com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:344)
	at deployment.ptsmc.ear//com.vaadin.base.devserver.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:356)
	at deployment.ptsmc.ear//com.vaadin.base.devserver.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:297)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

To reduce the variables, I wanted to build an empty project, but…

No starter is available as far as I can see.
Tried to use mvn archetype, but it didn’t find anything from 24.5.0.beta5

Tried to update the version in an older starter. Had to guess at spring-boot. Picked 3.3.4
Everything built, but again it failed at startup:

2024-10-04T09:58:56.173+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskUpdatePackages      : Running `npm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
2024-10-04T09:58:56.557+02:00  INFO 4304 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2024-10-04T09:58:58.024+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskUpdatePackages      : using 'C:\Users\guttorm.vik\.vaadin\node\node.exe C:\Users\guttorm.vik\.vaadin\node\node_modules\npm\bin\npm-cli.js --no-update-notifier --no-audit --scripts-prepend-node-path=true --ignore-scripts install' for frontend package installation
2024-10-04T09:58:58.314+02:00  INFO 4304 --- [  restartedMain] c.v.f.s.DefaultDeploymentConfiguration   :
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
2024-10-04T09:58:58.334+02:00  INFO 4304 --- [  restartedMain] c.vaadin.flow.spring.SpringInstantiator  : The number of beans implementing 'I18NProvider' is 0. Cannot use Spring beans for I18N, falling back to the default behavior
2024-10-04T09:58:58.365+02:00  INFO 4304 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2024-10-04T09:58:58.372+02:00  INFO 4304 --- [  restartedMain] com.example.application.Application      : Started Application in 5.041 seconds (process running for 5.5)
2024-10-04T09:58:59.930+02:00  INFO 4304 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-10-04T09:58:59.931+02:00  INFO 4304 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-10-04T09:58:59.942+02:00  INFO 4304 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 0 ms
2024-10-04T10:00:56.993+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskUpdatePackages      : Frontend dependencies resolved successfully.
2024-10-04T10:00:59.051+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskCopyFrontendFiles   : Copying frontend resources from jar files ...
2024-10-04T10:00:59.216+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskCopyFrontendFiles   : Visited 20 resources. Took 164 ms.
2024-10-04T10:00:59.554+02:00  INFO 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskRunDevBundleBuild   : Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
2024-10-04T10:01:08.698+02:00 ERROR 4304 --- [onPool-worker-1] c.v.f.s.frontend.TaskRunDevBundleBuild   : Command `C:\Users\guttorm.vik\.vaadin\node\node.exe C:\DeveloperArea\vaadin\starter-express\node_modules\vite\bin\vite.js build` failed:
vite v5.4.8 building for production...
transforming...
Comment replacement failed to change anything
? 557 modules transformed.
x Build failed in 4.55s
error during build:
node_modules/@vaadin-component-factory/vcf-nav/src/vcf-nav.ts (13:0): Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (Note that you need plugins to import files that are not JavaScript)
file: C:/DeveloperArea/vaadin/starter-express/node_modules/@vaadin-component-factory/vcf-nav/src/vcf-nav.ts:13:0

11: let id = 0;
12:
13: @customElement('vcf-nav')
    ^
14: export class Nav extends LitElement {
15:   @property({ type: Boolean, reflect: true })

    at getRollupError (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/parseAst.js:395:41)
    at ParseError.initialise (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:13231:28)
    at convertNode (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:14939:10)
    at convertProgram (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:14185:12)
    at Module.setSource (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:15925:24)
    at async ModuleLoader.addModuleSource (file:///C:/DeveloperArea/vaadin/starter-express/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19797:13)

This component is known not to work with the newest Vaadin versions. On the other hand it is not needed anymore as the framework has now SideNav component that is improved version of it. So the solution is to change your code to use SideNav.

Sounds like CSS file from leaflet map add-on. Did you do “mvn vaadin:clean-frontend”?

I’ve now done what I should’ve done from the start; Deleted the old starter, downloaded the latest 24.4 starter and upgraded that to 24.5. That runs without any issues, though since it doesn’t need to build the frontend it is not as good a test as I’d hoped.

So many times…

It is actually working now, but I have no idea why…

Some observations:

At some point I did verify that I had node_modules\leaflet\dist\leaflet.css, but it also had lots of xxx.DELETED.xxxxxx files

I also got lots of errors like this in my log:

101 warn tar TAR_ENTRY_ERROR ENOENT: no such file or directory, rename 'C:\DeveloperArea\dawinci-main\vaadin-upgrade\ptsmc-widgetset\node_modules\leaflet\LICENSE' -> 'C:\DeveloperArea\dawinci-main\vaadin-upgrade\ptsmc-widgetset\node_modules\leaflet\LICENSE.DELETE.ddbf99bc3c3eaa557ea15dbf3262cb00'

At this final run where it actually works, I got none of the tar errors, but I did notice that you spin up at least 20 threads to work on the dev bundle:

15:18:35,530 INFO  [com.vaadin.flow.server.frontend.TaskRunDevBundleBuild] (ForkJoinPool.commonPool-worker-1) Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
15:18:50,459 INFO  [com.vaadin.flow.server.frontend.TaskRunDevBundleBuild] (ForkJoinPool.commonPool-worker-1) Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
15:19:03,573 INFO  [com.vaadin.flow.server.frontend.TaskRunDevBundleBuild] (ForkJoinPool.commonPool-worker-8) Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
15:19:03,574 INFO  [com.vaadin.flow.server.frontend.TaskRunDevBundleBuild] (ForkJoinPool.commonPool-worker-3) Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
...

So, I am left wondering if your threads are interfering with each other?
Or maybe it is our corporate antivirus

Which Leaflet add-on you are using. There are three different add-ons that integrate that library in Directory?

I use

<dependency>
   <groupId>software.xdev</groupId>
   <artifactId>vaadin-maps-leaflet-flow</artifactId>
   <version>4.4.0</version>
</dependency>

Just to reiterate: It did go through frontend generation eventually, so whatever the issue was it shouldn’t be the add-on’s fault.