找不到模块“@vaadin/flow-frontend/Flow”

2024-01-10

Vaadin 突然停止构建我的库,并出现以下错误。我已经跳过 Vaadin 舞蹈(还有很多其他的东西),但我现在没有主意了。我尝试构建用于生产的库(但对于开发来说也失败了)。

我正在使用 Vaadin Flow。 Github 上的问题跟踪器重定向到这里寻求一般社区帮助 - 所以我希望任何人都知道如何解决这个问题或者我还可以尝试什么。

> Task vaadinBuildFrontend FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 'vaadinBuildFrontend'.
> Webpack process exited with non-zero exit code.
  Stderr: 'Hash: e1a6ace26ca6df86c87b
  Version: webpack 4.46.0
  Time: 6054ms
  Built at: 12/22/2021 7:13:38 PM
                                                Asset      Size  Chunks               Chunk Names
  VAADIN/build/vaadin-1-8595bda5c7958e210407.cache.js   894 KiB       1  [immutable]
  VAADIN/build/vaadin-2-d5ce16eeb5d943cfe059.cache.js   284 KiB       2  [immutable]
  VAADIN/build/vaadin-3-7d2fe309de5248ed4c09.cache.js  48.7 KiB       3  [immutable]
  VAADIN/build/vaadin-4-2758512dfda3ea8392cc.cache.js  1.05 KiB       4  [immutable]
  Entrypoint bundle =
    [0] ./generated/vaadin.ts + 2 modules 91.2 KiB {0} [built]
        | ./generated/vaadin.ts 18 bytes [built]
        | ./generated/index.ts 337 bytes [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/router/dist/vaadin-router.js 90.9 KiB [built]
    [1] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js 7.07 KiB {2} [built]
    [3] ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit/index.js + 3 modules 8.83 KiB {2} [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit/index.js 122 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/reactive-element.js 5.89 KiB [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit-element/lit-element.js 1.35 KiB [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/css-tag.js 1.46 KiB [built]
    [4] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/spacing.js 1.42 KiB {2} [built]
    [5] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/color.js 6.82 KiB {2} [built]
    [6] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/style.js 1.38 KiB {2} [built]
    [8] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/sizing.js 829 bytes {2} [built]
    [9] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/typography.js 2.99 KiB {2} [built]
   [27] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/version.js 313 bytes {2} [built]
   [43] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/button/theme/lumo/vaadin-button.js 73 bytes {1} [built]
   [80] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/icons.js + 2 modules 31.5 KiB {2} [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/icons.js 276 bytes [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/iconset.js 15.5 KiB [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/vaadin-lumo-styles/vaadin-iconset.js 15.7 KiB [built]
  [188] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/common-frontend/ConnectionIndicator.js + 14 modules 35.9 KiB {2} [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/common-frontend/ConnectionIndicator.js 14.3 KiB [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/tslib/tslib.es6.js 11.5 KiB [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit/decorators.js 525 bytes [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit/directives/class-map.js 85 bytes [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/common-frontend/ConnectionState.js 4.36 KiB [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/custom-element.js 364 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/property.js 572 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/state.js 225 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/event-options.js 280 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/query.js 612 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/query-all.js 388 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/query-async.js 392 bytes [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js 603 bytes [built]
        | ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection/node_modules/lit-html/directives/class-map.js 1.1 KiB [built]
        | ../node_modules/.pnpm/@lit/[email protected] /cdn-cgi/l/email-protection/node_modules/@lit/reactive-element/decorators/base.js 666 bytes [built]
  [217] ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/polymer-legacy-adapter/style-modules.js + 1 modules 4.38 KiB {2} [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/polymer-legacy-adapter/style-modules.js 191 bytes [built]
        | ../node_modules/.pnpm/@vaadin/[email protected] /cdn-cgi/l/email-protection/node_modules/@vaadin/polymer-legacy-adapter/src/style-modules.js 4.17 KiB [built]
  [222] ../build/frontend/generated-flow-imports-fallback.js + 56 modules 104 KiB {3} [built]
        | ../build/frontend/generated-flow-imports-fallback.js 9.98 KiB [built]
        | ./basic/variables.css 943 bytes [built]
        | ./images/cropper/cropper.css 778 bytes [built]
        | ./basic/spacer.css 116 bytes [built]
        | ./tab-box/tab-box.css 458 bytes [built]
        | ./text/text-area.css 103 bytes [built]
        | ./buttons/internal-button.css 104 bytes [built]
        | ./layouts/br-app-layout.css 206 bytes [built]
        | ./buttons/flat-icon-button.css 242 bytes [built]
        | ./modal/raven-modal.css 219 bytes [built]
        | ./headings/headings.css 60 bytes [built]
        | ./layouts/br-horizontal-layout.css 150 bytes [built]
        | ./text/text-line-with-icon.css 182 bytes [built]
        | ./input/br-inline-edit.css 159 bytes [built]
        | ./buttons/action-button.css 890 bytes [built]
        |     + 42 hidden modules
  [223] ../build/frontend/generated-flow-imports.js + 1 modules 1.72 KiB {4} [built]
        | ../build/frontend/generated-flow-imports.js 1.41 KiB [built]
        | ../build/flow-frontend/lumo-includes.ts 276 bytes [built]
      + 209 hidden modules

  ERROR in ./generated/index.ts
  Module not found: Error: Can't resolve '@vaadin/flow-frontend/Flow' in '/XXX/frontend/generated'
   @ ./generated/index.ts 2:0-50 3:33-37
   @ ./generated/vaadin.ts

  ERROR in chunk bundle [entry]
  VAADIN/build/vaadin-bundle-ca5b59ddaf6cebb1e7aa.cache.js
  /XXX/node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection[email protected] /cdn-cgi/l/email-protection/node_modules/esbuild-loader/dist/index.js??ref--4!/XXX/frontend/generated/vaadin.ts a8f7ce42c2f8c5128bbf70605fdcb37b
  Unexpected token (4:33)
  |
  |
  | const { serverSideRoutes } = new !(function webpackMissingModule() { var e = new Error("Cannot find module '@vaadin/flow-frontend/Flow'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({
  |   imports: () => Promise.all(/* import() */[__webpack_require__.e(2), __webpack_require__.e(4)]).then(__webpack_require__.bind(null, 223))
  | });

  ERROR in frontend/generated/index.ts:17:22
  TS2307: Cannot find module '@vaadin/flow-frontend/Flow' or its corresponding type declarations.
      15 |
      16 | // import Flow module to enable navigation to Vaadin server-side views
    > 17 | import { Flow } from '@vaadin/flow-frontend/Flow';
         |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      18 |
      19 | const { serverSideRoutes } = new Flow({
      20 |   imports: () => import('../../build/frontend/generated-flow-imports')
  Child HtmlWebpackCompiler:
                            Asset     Size  Chunks  Chunk Names
      __child-HtmlWebpackPlugin_0  4.4 KiB       0  HtmlWebpackPlugin_0
      Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
      [0] ../node_modules/.pnpm/[email protected] /cdn-cgi/l/email-protection[email protected] /cdn-cgi/l/email-protection/node_modules/html-webpack-plugin/lib/loader.js!./index.html 830 bytes {0} [built]
  <i> [build-status] 3 errors and 0 warnings were reported.
  <i> [build-status] : Failed to compile.
  '

// 编辑1

我已经尝试了所有这些(按此顺序):

rm -rf ~/.pnpm-store ~/.vaadin
rm -rf package.json pnpm-lock.json pnpmfile.json tsconfig.json webpack.config.js webpack.generated.js .npmrc frontend/generated/ frontend/index.html build/ target/ node_modules pnpm-lock.yaml pnpmfile.js types.d.ts
./gradlew vaadinClean && ./gradlew vaadinPrepareFrontend && ./gradlew vaadinBuildFrontend

我从 V21 迁移到 V22 时遇到了同样的问题。我通过删除目标文件夹(以及根文件夹中生成的文件,如 tsconfig 等)并再次重建来修复它。之后工作完美,没有再出现任何问题。我怀疑 V21 的目标文件夹中存在某些内容,并且混淆了构建。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

找不到模块“@vaadin/flow-frontend/Flow” 的相关文章

  • 在 Vaadin 7 应用程序中使用推送在多个客户端之间显示相同的数据

    我想向多个客户端共享同一组数据 我需要使用推送来自动更新他们在屏幕上的视图 我已阅读问题和答案 Vaadin 7 应用程序中推送的最小示例 Push https stackoverflow com q 27808460 642706 现在我
  • 如何在 Vaadin ComboBox 中添加搜索图标?

    我有一个ComboBox允许选择给定的项目 以及接受选择的图标 功能都很好 我正在寻找将搜索图标放入组合框中的效果 像瓦丁图标 https vaadin com icons 这是怎么做到的 I tried comboBox setIcon
  • 使用数据源将文本添加到组合框

    我有一个 vaadin 组合框 里面装有容器数据源 setContainerDataSource container 我现在想在结果列表中的某处插入静态文本 例如 一个组合框充满了一个容器 结果列表中弹出的第一个条目是某种标题 Person
  • Vaadin - 布局调整重叠大小

    当尝试调整浏览器大小时 我面临与我的项目重叠的问题 我尝试了很多不同的变体来使其发挥作用 但结果仍然不可接受 Before resizing A B and C包含在垂直布局 https vaadin com api com vaadin
  • 如何通过 Apache HTTP 服务器让 Vaadin Push 工作?

    我正在尝试让 Vaadin 7 1 5 Push 在 Apache Tomcat 7 0 42 Apache HTTP 服务器 带有 mod proxy wstunnel 的 2 2 14 上工作 当我直接访问 Tomcat 时 即 使用
  • 在 Liferay 中控制 Portlet 的大小

    我有一个简单的 Vaadin portlet 它显示嵌入式页面 例如 www stackoverflow com 在 Liferay 中 我将 portlet 所在的页面布局设置为 1 列布局 以便 portlet 填满整个页面 现在 如果
  • Vaadin 14 中列标题中的文本可以换行到网格中的多行吗?

    在上图中 我有一个Grid https vaadin com components vaadin grid在 Vaadin 14 中创建 请注意列标题 未换行的红线 我试图弄清楚是否有可能 并且安全 简单 标准 让列标签换行 例如 就像在
  • 在 Vaadin 视图中显示 PDF

    我想在 Vaadin 视图中显示 PDF 我创建一个 BrowserFrame 并传递 PDF 的 StreamResource StreamResource streamResource new StreamResource getPre
  • Vaadin 将 JavaScript 流转至 Java 调用

    按照本教程进行操作https vaadin com blog calling java from javascript https vaadin com blog calling java from javascript我试图从 javas
  • 使用 VaadinServlet 摆脱 Vaadin 7 中的 web.xml

    我是 Java 和 Vaadin 的新手 一个基本的 Vaadin 项目正在使用web xml对于所有映射 如果我想使用 WebServlet注释我需要创建一个从某处继承的内部类HttpServlet SuppressWarnings se
  • 重新启动 Vaadin 应用程序时抛出 java.io.NotSerializedException

    当我重新启动 Tomcat 时 出现以下错误 2014 10 01 15 49 47 055 WARN com vaadin event ListenerMethod localhost startStop 2 Error in seria
  • Vaadin 组件作为 Spring bean

    问题 当 Vaadin 组件可以是 spring 容器中的 bean 时 SpringComponent注解 问题澄清 我问这个问题是因为我知道 Vaadin View 使用后可能是 spring bean SpringView 但如果我注
  • Vaadin 更改默认会话过期通知?

    瓦丁7 6 2 如何更改默认的会话过期通知 消息和通知类型 要更改会话过期消息 您需要创建自己的SystemMessagesProvider 您在其中定义它 例如 在 Servlet 部署中 您可以执行以下操作 WebServlet url
  • 通过代码更改 Vaadin 7 中的主题

    我正在 Vaadin 7 中做一个项目 我需要更改页面的主题 在 Vaadin 6 中 有一个名为 setTheme 的函数 这样我就可以在代码中的任何位置使用该函数更改主题 但是 在 Vaadin 7 中 我找不到类似的东西 我知道会有办
  • 如何在 Vaadin 7 表中实现滚动监听器

    在 Vaadin 中 当您在表格中向下或向上滚动时 com vaadin ui Table 不会触发任何事件来告诉您用户正在滚动 为什么我们需要在表格中滚动事件 我们先来看看 Vaadin 这个例子 仪表板演示 http demo vaad
  • 如何在 Vaadin 中禁用浏览器缓存

    我的问题很短 希望很容易解决 我怎样才能完全禁用我的浏览器缓存用vaadin实现的webservice 我想完全禁用缓存 因为当我尝试进行一些 PDF 流式传输并在浏览器中显示它们时遇到问题 我已经阅读了有关我的问题的解决方案 例如这里 使
  • 使用 Vaadin 声明式 UI 时如何设置自定义字体图标?

    我正在使用自定义字体图标集 如 wiki 文章中所述Vaadin 7 2 中的字体图标 https vaadin com wiki wiki Main Using font icons 一切正常 但是 如果我使用声明式 UI 我将无法使其正
  • 如何从传统的java web应用程序(带有web.xml)迁移到spring boot?

    我想将我的项目切换到基于弹簧的产品 我的第一步是将我的 java web 应用程序从生成的 WAR 文件转换为由 spring boot 提供支持的独立可执行 jar 让我们从 github 中获取一个开源 Web 应用程序示例 Vaadi
  • 使用 iText 和 Batik 生成 PDF

    我正在尝试将文本和 SVG 图形导出为 PDF 我发现 iText 和 batik 可以做到这一点 所以我尝试这样做 但每次我放入图表时 它都会变得非常小 我认为这可能与我的代码有关 所以我想我应该尝试 Vaadin 的示例代码 publi
  • 使用 Vaadin 生成 HTML 速度缓慢

    我是一个有问题的开发人员 目前我们的项目 使用 Vaadin 即将结束 但是 我们在其中一个视图中显示简单数据时遇到了一些麻烦 Vaadin 完成生成后 需要显示超过 500 KB 的数据 以及超过 15K 的 DOM 元素 在完成之前需要

随机推荐