构建失败 - 检查导入 - Dart Angular Tutorial - angular_tour_of_heroes - 第2部分

问题描述 投票:1回答:2

按照教程 - 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:53323lib/app_component.css, lib/app_component.dart, lib/app_component.html, lib/src/hero.dart & lib/src/mock_heroes.dart但我仍然得到上述错误& -

  1. 我找不到任何Review the app structure
  2. 也无法在路径中使用IntelliJ Find找到导入的app_component.template.dartpackage:angular_app/app_component.css.shim.dart的任何实例(Ctrl + Shift + F)
  3. 我试图删除构建和重建。
  4. 我还使用windows包管理器重新安装了dart 2.1.0并在IntelliJ IDEA设置/ Dart中相应地更改了dart-sdk的位置,因为短暂的时间我得到了dart-sdk错误,但这是固定的。

这是我第一次询问有关stackoverflow的问题,但我检查了类似的问题,无法解决该问题。

dart angular-dart
2个回答
0
投票

构建失败的最可能原因是找不到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下的项目中找到


0
投票

我有一个非常相似的问题。我跑了.dart_tool/build/generated/angular_app/lib,然后webdev build然后把它修好了。

© www.soinside.com 2019 - 2024. All rights reserved.