簡體   English   中英

遷移到Dart 2時,出現“檢查導入錯誤”,這意味着尚未生成某些模板

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

我正在嘗試遷移到Dart 2,我有很多軟件包,到目前為止,我可以完成很多工作。 現在,我得到了一個帶有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

... 和更多

正確地表明沒有導入(MainSelectionBar是一個角度分量),因為尚未生成模板。 現在的問題是,為什么模板不存在? 我檢查了.dart_tool / build / generated目錄,但是尚未創建模板。 我有一個類似的程序包,其相似的組件工作正常,所以我無法弄清楚發生了什么。 在哪里可以找到更詳細的錯誤列表? 有趣的是,在某些情況下還存在模板,但其顯示方式類似於未找到它。...有任何提示嗎?

這很可能與生成模板時的構建失敗有關,該失敗在后續構建中未正確報告。 這個拉取請求應該可以幫助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