【问题标题】:Dart web tutorial problem re-generating the app componentDart web教程问题重新生成app组件
【发布时间】:2018-09-24 12:42:41
【问题描述】:

我正在尝试在 https://webdev.dartlang.org/angular/tutorial/toh-pt5 处学习 Dart Web 教程

为了确保从正确的基础开始,我下载了上一章末尾的模板 toh-4-master。它构建并运行良好,然后我按照指南移动和重命名应用程序组件,然后创建手动新建一个,但是在遵循“创建应用程序组件”之后,指南指出重新加载页面并且应用程序应该可以工作,但是我收到了下面的错误。

这表明它没有正确生成 app_component.template 文件,知道如何调试它吗?

SEVERE] build_web_compilers|entrypoint on test/app_test.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 'src/hero_list_component.template.dart' as _ref1; from angular_tour_of_heroes|lib/app_component.template.dart at 13:1

[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 'src/hero_list_component.template.dart' as _ref1; from angular_tour_of_heroes|lib/app_component.template.dart at 13:1

[SEVERE] build_web_compilers|entrypoint on test/app_test.dart.browser_test.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 'src/hero_list_component.template.dart' as _ref1; from angular_tour_of_heroes|lib/app_component.template.dart at 13:1

[SEVERE] Failed after 943ms
Serving web on http://localhost:8080
Serving test on http://localhost:8080

【问题讨论】:

  • 尝试删除 .dart_tool 并仔细检查您的模板路径

标签: dart angular-dart


【解决方案1】:

您是否也重命名了组件文件?

如果是这样,则从包含组件的文件生成 template.dart 文件。所以它将遵循模式 component.dart -> component.template.dart

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-25
    • 1970-01-01
    • 1970-01-01
    • 2011-01-03
    • 2012-10-20
    • 1970-01-01
    • 2019-05-26
    • 2014-12-28
    相关资源
    最近更新 更多