按照教程 - qazxsw poi
使用Chrome时在Windows 10中使用IntelliJ IDEA,我收到以下错误 -
Angular-dart tutorial - Tour of Heroes - part 2
[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
我已多次检查并且我已经替换了所有 - 5个文件 - 即来自Serving web on http://localhost:53323
的lib/app_component.css, lib/app_component.dart, lib/app_component.html, lib/src/hero.dart & lib/src/mock_heroes.dart
但我仍然得到上述错误& -
app_component.template.dart
或package:angular_app/app_component.css.shim.dart
的任何实例(Ctrl + Shift + F)这是我第一次询问有关stackoverflow的问题,但我检查了类似的问题,无法解决该问题。
构建失败的最可能原因是找不到stylesUrls文件。这可能是因为该数组中的名称与文件系统中的名称不匹配,或者不是文件系统中的预期位置。
为了确认,我从头开始,下载了quickstart-master.zip以获得项目结构。并且在您坚持的步骤中一直遵循这些步骤。我在跟踪步骤时唯一能够生成错误的是我在创建文件之前将shim
添加到styleUrls: ['app_component.css'],
。
我也一样:
[SEVERE] build_web_compilers | test / app_test.dart.browser_test.dart上的入口点:无法找到某些源的模块,这通常是导入错误,包中缺少依赖项(或者dev_dependency需要移动)的结果到真正的依赖)或构建失败(如果导入生成的文件)。
请检查以下导入:
app_component.dart
来自angular_app | lib / app_component.template.dart,时间为12:1
一旦我创建了css文件,错误就消失了,一切正常。我完成了你所做的整个步骤,我的应用程序运行正常。然后我按照你的方式做了并从步骤中复制了每个文件并用它替换了我的工作,仍然有效。所以确认我的预感,我改变了css文件的名称,并收到了同样的错误。
关于import 'package:angular_app/app_components.css.shim.dart' as import0;
该文件是由dart自动生成的,可以在app_component.template.dart
下的项目中找到
我有一个非常相似的问题。我跑了.dart_tool/build/generated/angular_app/lib
,然后webdev build
然后把它修好了。