vaadinvaadin20

Vaadin: again: build completely stalled


For the second time I just banged into this situation where a change of the Vaadin version completely halts my build process:

The issue started when I wanted to give my project - which has been building and executing fine - a try to update it from Vaadin 18.0.2 to 20.0.2. Strange enough this did not work: While the project built fine and also started without error or exception, the UI did not show up. All attempts to load the startup page only yielded a blue progress bar that quickly progressed to about mid screen and then got slower and slower and eventually the request time out. No error message, simply nothing :-( Most disappointing already!

Thus I reverted the Vaadin version in the pom.xml back to v18.0.2 and now I am stuck. When trying to build the project I run into this error:

...
[INFO] --- vaadin-maven-plugin:18.0.2:build-frontend (default) @ kis-monitoring ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 2737 classes. Took 3034 ms.
[INFO] Visited 141 classes. Took 61 ms.
[INFO] writing file U:\workspace_Vaadin\my_project\target\flow-frontend\package.json.
[INFO] writing file U:\workspace_Vaadin\my_project\target\flow-frontend\form\package.json.
[INFO] writing file 'U:\workspace_Vaadin\my_project\target\index.html'
[INFO] writing file 'U:\workspace_Vaadin\my_project\target\index.ts'
[INFO] Parsing java files from [U:\workspace_Vaadin\my_project\src\main\java]
[INFO] There are no connect endpoints to generate.
[INFO] Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
[INFO] Generated pnpmfile hook file: 'U:\workspace_Vaadin\my_project\pnpmfile.js'
[INFO] installing pnpm version 4.4.0 locally
[INFO] using 'C:\Users\mms\.vaadin\node\node.exe C:\Users\mms\.vaadin\node_modules\pnpm\bin\pnpm.js' for frontend package installation
[ERROR] Command `C:\Users\mms\.vaadin\node\node.exe C:\Users\mms\.vaadin\node_modules\pnpm\bin\pnpm.js --shamefully-hoist=true install` failed:
Using hooks from: U:\workspace_Vaadin\my_project\pnpmfile.jsreadPackage hook is declared. Manifests of dependencies might get overridden?WARN? Your pnpm-lock.yaml was generated by a newer version of pnpm. It is a compatible version but it might get downgraded to version 5.1?WARN? deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported?ERROR? No package.json (or package.yaml, or package.json5) was found in "U:\workspace_Vaadin\my_project\target\plugins\stats-plugin".
[ERROR] >>> Dependency ERROR. Check that all required dependencies are deployed in pnpm repositories.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Last time I ran into this I spent a long time trying to get this building again! I tried the "Vaadin-dance", I uninstalled everything related to node.js, npm, rnpm, etc. from my system, and much more and NOTHING helped to fix this. In the end the only fix that worked turned out to be by restarting my project from scratch by creating and downloading a newly generated hello-world program and copying my source code in it.

This time I want to understand what is going off-rail here and how to fix this situation without restarting from scratch again! How/why can changing the Vaadin version and changing it back later cause this build issue? And what exactly is needed to get this working again?


Solution

  • With the jump from V20 to V18 there is the problem that V19 brought in the new Theming feature which uses plugins for webpack that are installed using npm/pnpm and the package.json gets the devDependencies:

        "@vaadin/application-theme-plugin": "./target/plugins/application-theme-plugin",
        "@vaadin/stats-plugin": "./target/plugins/stats-plugin",
        "@vaadin/theme-live-reload-plugin": "./target/plugins/theme-live-reload-plugin",
        "@vaadin/theme-loader": "./target/plugins/theme-loader",
    

    These will not exist aster a mvn clean and v18 doesn't know about this to clear them either.

    The important information was hidden at the end of the [ERROR] >>> Dependency ERROR line No package.json (or package.yaml, or package.json5) was found in "U:\workspace_Vaadin\my_project\target\plugins\stats-plugin".

    To have the V18 run again you should remove the devDependencies targeting ./target/* and possibly clean ~/.vaadin so that the pnpm version is the correct one.

    What failed for 18->20 I can't say as you didn't give any information on that, but 20->18 failed due to 20 having new features that are not automatically removed for a downgrade as 18 is EOL and downgrading is not expected.