首页 > 解决方案 > Vaadin:再次:构建完全停滞

问题描述

这是我第二次遇到这种情况,即 Vaadin 版本的更改完全停止了我的构建过程:

当我想给我的项目(一直在构建和执行良好)尝试将其从 Vaadin 18.0.2 更新到 20.0.2 时,问题就开始了。奇怪的是这不起作用:虽然项目构建良好并且也没有错误或异常地启动,但 UI 没有显示。所有加载启动页面的尝试都只产生了一个蓝色进度条,该进度条快速进展到屏幕中间,然后变得越来越慢,最终请求超时。没有错误信息,什么都没有 :-( 最令人失望了!

因此,我将 pom.xml 中的 Vaadin 版本恢复为 v18.0.2,现在我被卡住了。在尝试构建项目时,我遇到了这个错误:

...
[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] ------------------------------------------------------------------------

上次我遇到这个我花了很长时间试图再次获得这座建筑!我尝试了“Vaadin-dance”,我从我的系统中卸载了与 node.js、npm、rnpm 等相关的所有内容,还有更多,但没有任何帮助解决这个问题。最后,唯一可行的解​​决办法是通过创建和下载一个新生成的 hello-world 程序并在其中复制我的源代码来从头开始重新启动我的项目。

这次我想了解这里发生了什么脱轨以及如何在不重新从头开始的情况下解决这种情况!如何/为什么更改 Vaadin 版本并稍后将其更改回导致此构建问题?究竟需要什么才能让它再次工作?

标签: vaadinvaadin20

解决方案


随着从 V20 到 V18 的跳跃,V19 引入了新的主题功能,该功能使用使用 npm/pnpm 安装的 webpack 插件并package.json获取 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",

这些将不存在 aster a mvn clean 并且 v18 也不知道如何清除它们。

重要信息隐藏在行[ERROR] >>> Dependency ERRORNo package.json (or package.yaml, or package.json5) was found in "U:\workspace_Vaadin\my_project\target\plugins\stats-plugin".

要让 V18 再次运行,您应该删除 devDependencies 目标./target/*并可能进行清理~/.vaadin,以便 pnpm 版本是正确的。

18->20 失败的原因我不能说,因为您没有提供任何相关信息,但是 20->18 失败是因为 20 具有不会自动删除降级的新功能,因为 18 是 EOL,降级是没想到。


推荐阅读