0

在一个相当简单的 Vaadin 20.0.3 项目中运行./gradlew vaadinBuildFrontend --stacktrace会导致

[...]
Caused by: com.vaadin.flow.server.ExecutionFailedException: Error occured during goal execution: Could not write exported web component module because of exception: Path provided by parameter 'outputDirectory' (PROJECT/SUBPROJECT/build/frontend) is not a directoryPlease run Maven with the -e switch (or Gradle with the --stacktrace switch), to learn the full stack trace.
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:307)
        at com.vaadin.gradle.VaadinBuildFrontendTask.vaadinBuildFrontend(VaadinBuildFrontendTask.kt:73)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        ... 119 more
Caused by: java.lang.RuntimeException: Could not write exported web component module because of exception: Path provided by parameter 'outputDirectory' (PROJECT/SUBPROJECTe/build/frontend) is not a directory
        at com.vaadin.flow.server.webcomponent.WebComponentModulesWriter$DirectoryWriter.generateWebComponentsToDirectory(WebComponentModulesWriter.java:264)
        at com.vaadin.flow.server.frontend.FrontendWebComponentGenerator.generateWebComponents(FrontendWebComponentGenerator.java:95)
        at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:597)
        at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:54)
        at com.vaadin.flow.server.frontend.NodeTasks$Builder.build(NodeTasks.java:215)
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:300)
        ... 121 more
Caused by: java.lang.IllegalArgumentException: Path provided by parameter 'outputDirectory' (PROJECT/SUBPROJECT/build/frontend) is not a directory
        at com.vaadin.flow.server.webcomponent.WebComponentModulesWriter.writeWebComponentsToDirectory(WebComponentModulesWriter.java:91)
        at com.vaadin.flow.server.webcomponent.WebComponentModulesWriter$DirectoryWriter.generateWebComponentsToDirectory(WebComponentModulesWriter.java:250)
        ... 126 more

vaadin 的 config 闭包没有配置任何目录,所以插件应该使用默认值:

vaadin {
    optimizeBundle = false
    productionMode = false
    pnpmEnable = true
}

在运行任务之前创建build/frontend目录没有帮助。它在异常之前被删除。

4

1 回答 1

1

https://github.com/vaadin/flow/issues/8033票听起来很相似。您可以尝试运行 Gradle--dry-run以查看 vaadinPrepareFrontend 任务是否已运行?

由于这看起来像一个错误,最好的办法是在https://github.com/vaadin/flow/issues打开一个错误报告。

另外,请阅读如何在多项目构建中使用 Vaadin Gradle 插件:https ://github.com/vaadin/vaadin-gradle-plugin/#multi-project-builds

于 2021-07-02T12:18:50.583 回答