微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Vaadin:再次:构建完全停滞

如何解决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 版本并稍后将其更改回来会导致此构建问题?究竟需要什么才能让它再次工作?

解决方法

随着从 V20 到 V18 的跳跃,V19 引入了新的 Theming 功能的问题,该功能使用使用 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 ERROR行的末尾No package.json (or package.yaml,or package.json5) was found in "U:\workspace_Vaadin\my_project\target\plugins\stats-plugin".

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

18->20 失败的原因我不能说,因为你没有提供任何信息,但是 20->18 失败了,因为 20 有新功能不会自动删除降级,因为 18 是 EOL预计不会降级。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。