簡體   English   中英

路由Dart Angular Tour of Heroes時無法找到模塊

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM