在一个相当简单的 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
目录没有帮助。它在异常之前被删除。