簡體   English   中英

構建失敗-檢查導入-Dart Angular教程-angular_tour_of_heroes-第2部分

[英]Build failed - Check imports - Dart Angular Tutorial - angular_tour_of_heroes - part 2

跟隨tutorail時-Angular 飛鏢教程-英雄之旅-第2部分

在使用Chrome的同時在Windows 10中使用IntelliJ IDEA的問題,出現以下錯誤-

[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:angular_app/app_component.css.shim.dart' as import0; from angular_app|lib/app_component.template.dart at 12:1

[SEVERE] Failed after 1.3s Serving web on http://localhost:53323

我曾多次檢出&我已經更換了所有- 5文件-即lib/app_component.css, lib/app_component.dart, lib/app_component.html, lib/src/hero.dart & lib/src/mock_heroes.dart評論應用程序結構,但仍然出現上述錯誤&-

  1. 我找不到任何app_component.template.dart

  2. 使用IntelliJ在路徑中查找(Ctrl + Shift + F)也找不到導入的package:angular_app/app_component.css.shim.dartshim任何實例

  3. 我試圖刪除構建並重建。

  4. 我還使用Windows軟件包管理器重新安裝了dart 2.1.0,並在IntelliJ IDEA設置/ Dart中相應地更改了dart-sdk的位置,因為在短時間內我遇到了dart-sdk錯誤,但已修復。


這是我第一次在stacksoverflow上提問,但是我檢查了類似的問題,無法解決該問題。

生成失敗的最可能原因是由於找不到stylesUrls文件。 這可能是因為該數組中的名稱與文件系統中的名稱不匹配,或者不是文件系統中的預期位置。

為了確認,我從頭開始,下載了quickstart-master.zip以獲得項目結構。 並按照步驟進行,直到您陷入困境。 在執行這些步驟時,唯一能夠生成該錯誤的時間是在創建文件之前,將styleUrls: ['app_component.css'],app_component.dart

我也一樣:

[SEVERE] test / app_test.dart.browser_test.dart上的build_web_compilers |入口點:無法為某些源找到模塊,這通常是由於導入錯誤,包中缺少依賴項(或者可能需要移動dev_dependency導致的)到真正的依賴關系),或構建失敗(如果導入生成的文件)。

請檢查以下進口:

import 'package:angular_app/app_components.css.shim.dart' as import0; 來自angular_app | lib / app_component.template.dart,時間為12:1

創建css文件后,錯誤消失了,一切正常。 我完成了您要完成的整個步驟,並且我的應用程序運行正常。 然后,我按照您的方式進行操作,並復制了該步驟中的每個文件,並用它替換了我的工作,但仍然有效。 因此,請確認我的直覺,我更改了css文件的名稱,並收到了相同的錯誤。

關於app_component.template.dart ,該文件是dart自動生成的,可以在您的項目中的.dart_tool/build/generated/angular_app/lib

我有一個非常類似的問題。 我跑webdev build ,然后webdev serve ,並將其固定它的權利了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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