Vaadin 14.1.3 Slow startup 6-9 minutes

Hi,
I downloaded a sample project with spring boot and latest vaadin. The startup time for me way too slow. I did the whitelist-packages setting to scan only the project files. Can you tell what is wrong from the log?

2020-01-07 17:42:10,095 INFO  o.s.w.c.ContextLoader - Root WebApplicationContext: initialization completed in 2578 ms
2020-01-07 17:42:11,886 INFO  c.v.f.s.VaadinServletContextInitializer - Search for subclasses and classes with annotations took 1 seconds
2020-01-07 17:42:11,893 INFO  c.v.f.s.s.DevModeInitializer - Starting dev-mode updaters in C:\Users\a629783\workspace\kafka-resync folder.
2020-01-07 17:42:11,949 INFO  dev-updater - Visited 96 classes. Took 23 ms.
2020-01-07 17:42:11,982 INFO  dev-updater - Skipping `npm install`.
2020-01-07 17:42:11,983 INFO  dev-updater - Copying frontend resources from jar files ...
2020-01-07 17:42:12,410 INFO  dev-updater - Visited 12 resources. Took 427 ms.
2020-01-07 17:42:12,505 WARN  dev-updater - Use the './' prefix for files in the 'C:\Users\a629783\workspace\kafka-resync\.\frontend' folder: 'src/views/failures/failures-view.js', please update your annotations.
2020-01-07 17:42:12,514 WARN  dev-updater - Use the './' prefix for files in the 'C:\Users\a629783\workspace\kafka-resync\.\frontend' folder: 'src/views/history/history-view.js', please update your annotations.
2020-01-07 17:42:12,531 INFO  dev-updater - No js modules to update 'C:\Users\a629783\workspace\kafka-resync\target\frontend\generated-flow-imports.js' file

---------------- Nothing happens in log here ------------------------------

2020-01-07 17:48:37,133 INFO  dev-webpack - Starting webpack-dev-server, port: 61826 dir: C:\Users\a629783\workspace\kafka-resync
2020-01-07 17:48:37,157 INFO  dev-webpack - Waiting for webpack compilation before proceeding.
2020-01-07 17:48:54,004 INFO  dev-webpack - Webpack startup and compilation completed in 16871ms
2020-01-07 17:48:54,372 INFO  o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor'
2020-01-07 17:48:54,785 INFO  o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729
Jan 07, 2020 5:48:55 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]

2020-01-07 17:48:55,102 INFO  o.s.b.w.e.t.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
2020-01-07 17:48:55,106 INFO  c.f.k.Application - Started Application in 408.511 seconds (JVM running for 410.717)

Hi.

At that point there shouldn’t be anything happening as webpack should start directly after the No js modules to update log.

Is there some process that waits or does something when hitting that point? If you press enter instead of waiting does it skip the wait?

  • Mikael

Pressing enter does not help. The entire thing is not making any sense since I have made no changes after downloading the sample project from Vaadin or the spring-boot starter with Vaadin. Except for whitelisting packages.

Could there be anything waiting for the network ? The code is behind the corporate proxy which needs authenticataion.

Does running node node_modules\webpack\bin\webpack.js in the project directory take as long before it starts?

The only other thing that comes to mind is that for spring-boot application downloaded from start.spring.io this would be the first time that validateNodeAndNpmVersion is run which has had problems with proxies.

One fix for it has been to disable [strict-ssl]
(https://docs.npmjs.com/misc/config#strict-ssl) for npm.

The main problem where npm tried to check for updates withouth using proxy settings should have been solved, but you can try also npm set update-notifier=false that saves the variable to the .npmrc [see thread]
(https://vaadin.com/forum/thread/17779813/17930518)

  • Mikael

Mikael Grankvist:
The main problem where npm tried to check for updates withouth using proxy settings should have been solved, but you can try also npm set update-notifier=false that saves the variable to the .npmrc

This has solved the issue. I updated the .npmrc and now the startup time is ~40 seconds.

Thank you so much.