[英]Unable to find modules when routing Dart Angular Tour of Heroes
我一直在關注Dart Angular Tour of Heroes教程 。 我進入第5部分,教授路由。 但是我被困在路由器可用的部分 。 我鍵入了代碼,但它沒有構建。 我收到以下錯誤:
[SEVERE] build_web_compilers|entrypoint on web/main.dart:
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:angular_tour_of_heroes/app_component.template.dart' as ng;` from angular_app|web/main.template.dart at 10:1
`import 'package:angular_tour_of_heroes/app_component.template.dart' as ng;` from angular_app|web/main.dart at 3:1
要修復我嘗試過的錯誤:
pubspec.yaml
是正確的。 pub get
以及運行pub upgrade
。 謝謝。
抱歉,我沒有完成本教程,但app_component是本教程前面創建的文件。 angular_tour_of_heroes
是示例中使用的包名稱。
因此,對於您自己的教程,您可能希望使用:
import 'package:USE_YOUR_PACKAGE_NAME/app_component.template.dart' as ng;
將USE_YOUR_PACKAGE_NAME
替換為pubspec.yaml
文件name: USE_YOUR_PACKAGE_NAME
下的name: USE_YOUR_PACKAGE_NAME
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.