简体   繁体   English

迁移到Dart 2时,出现“检查导入错误”,这意味着尚未生成某些模板

[英]Migrating to Dart 2 I get a “check imports error” that means that some templates have not been generated

I'm trying to migrate to Dart 2, I have a lot of packages and up to now I could do my job with not so much problems. 我正在尝试迁移到Dart 2,我有很多软件包,到目前为止,我可以完成很多工作。 Now I'm getting a strange error bot with DDC and dart2js: 现在,我得到了一个带有DDC和dart2js的奇怪的错误机器人:

[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached):
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

`import 'package:ledger_web/src/ui/components/main_selection_bar.template.dart';` from ledger_web|lib/src/ui/components/service/main_selection_bar_service.dart at 7:1
`import 'package:ledger_web/src/ui/components/main_selection_bar.template.dart';` from ledger_web|lib/src/ui/components/service/main_selection_bar_service.template.dart at 11:1

... and more ... 和更多

It is correct to signal that there is not the import (MainSelectionBar is an angular component), because the template has not been generated. 正确地表明没有导入(MainSelectionBar是一个角度分量),因为尚未生成模板。 Now the problem is, why the template is not there? 现在的问题是,为什么模板不存在? I checked the .dart_tool/build/generated directory but the template has not been created. 我检查了.dart_tool / build / generated目录,但是尚未创建模板。 I have a similar package with a similar component that works fine, so I cannot figure out what's happened. 我有一个类似的程序包,其相似的组件工作正常,所以我无法弄清楚发生了什么。 Is there a place where there is a more detailed error list? 在哪里可以找到更详细的错误列表? Interestingly enough, there is also a case in which the template exists, but it is listed like if it was not found.... Any hint? 有趣的是,在某些情况下还存在模板,但其显示方式类似于未找到它。...有任何提示吗?

Most likely this is related to a build failure when generating the template, which is not being properly reported on subsequent builds. 这很可能与生成模板时的构建失败有关,该失败在后续构建中未正确报告。 This pull request should help that https://github.com/dart-lang/build/pull/1834/ , but you can also try running pub run build_runner clean and then doing a new build to get the original error back. 这个拉取请求应该可以帮助https://github.com/dart-lang/build/pull/1834/ ,但是您也可以尝试运行pub run build_runner clean然后进行新的构建以恢复原来的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM