首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >加载包失败- Dart角教程

加载包失败- Dart角教程
EN

Stack Overflow用户
提问于 2018-04-02 16:04:26
回答 2查看 801关注 0票数 0

我试着学习与飞镖成角教程。在我到达导航章之前一切都很顺利。当我使用webstorm和get运行这个项目时,我总是会得到这个错误。我也试图运行溶液回购,但是我得到了同样的错误。这些包,浏览器/角度等似乎没有加载。也许网络风暴有一些限制?!有趣的是,它偶尔会在第一次运行时工作,但是当我在浏览器中刷新页面时,错误总是会出现。

代码语言:javascript
复制
http://localhost:63342/toh-5-master/web/packages/browser/dart.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:63342/toh-5-master/web/packages/angular/angular.dart Failed to load resource: the server responded with a status of 404 (Not Found)
package:angular/angular.dart:1 An error occurred loading file: package:angular/angular.dart
http://localhost:63342/toh-5-master/web/packages/angular_router/angular_router.dart Failed to load resource: the server responded with a status of 404 (Not Found)
package:angular_router/angular_router.dart:1 An error occurred loading file: package:angular_router/angular_router.dart
http://localhost:63342/toh-5-master/web/packages/angular_tour_of_heroes/app_component.dart Failed to load resource: the server responded with a status of 404 (Not Found)
package:angular_tour_of_heroes/app_component.dart:1 An error occurred loading file: package:angular_tour_of_heroes/app_component.dart

编辑上面的内容现在正在工作,因为我更改为repo:Github.com/角-实例/toh-5/tree/5-dev,它与Dart 2一起工作。

现在,我有另一个问题与新的5开发回购。这是我的酒吧服务控制台。上面说main.template.dart失踪了。(我使用的是Dart版本的2.0.0-dev.44.0.)

有谁能解决这个问题吗?

代码语言:javascript
复制
Compiling angular_tour_of_heroes|web/main.dart...
[web] GET styles.css => (cached) angular_tour_of_heroes|web/styles.css
[Error from Dart2JS on angular_tour_of_heroes|web/main.dart]:
file:///C:/xampp/htdocs/flutterprojects/toh-5-5-dev/web/main.template.dart: Could not find asset angular_tour_of_heroes|web/main.template.dart.
[Info from Dart2JS]:
Took 0:00:03.911463 to compile angular_tour_of_heroes|web/main.dart.
Build completed with 1 errors.
[web] GET main.dart.js => Could not find asset angular_tour_of_heroes|web/main.dart.js.
[web] GET index.html => angular_tour_of_heroes|web/index.html

当我直接用控制台运行它时,我会得到以下错误。

>发布服务--web编译器=dartdevc

代码语言:javascript
复制
Build completed successfully
[web] GET  => angular_tour_of_heroes|web/index.html
[web] GET styles.css => angular_tour_of_heroes|web/styles.css
Unable to find module for angular|lib/src/bootstrap/modules.template.dart
Unable to find module for angular|lib/src/bootstrap/modules.template.dart
Unable to find module for angular|lib/src/bootstrap/modules.template.dart
EN

回答 2

Stack Overflow用户

发布于 2018-04-03 12:51:21

用于角4示例应用程序

如果您的应用程序中有一个错误阻止dart2js成功编译,则可能会发生类似的加载失败。在WebStorm的Pub选项卡中,发布是否报告了任何错误或警告?还要确保您使用的是Dart的1.24.3版。

我无法重现你提到的问题。我已经下载了这个项目zip,它在命令行和WebStorm上都运行得很好(即使在做了一些编辑和刷新之后)。请注意,当您第一次加载应用程序时,您可能会得到404,因为pub可能还没有完成对应用程序的编译。

用于角5示例应用程序

正如您已经发现的,如果您想要尝试使用角5-alpha的例子,切换到回购的5-dev分支。确保您至少使用了Dart 2-dev版本的SDK。

Dart 2 SDK不再支持pub buildpub serve的。从2018Q2开始,您就不能使用WebStorm来构建和服务Range5应用程序。相反,您需要在命令行中这样做:

pub run build_runner serve

然后在Chrome中打开localhost:8080。有关详细信息,请参阅角5 发展机构

票数 2
EN

Stack Overflow用户

发布于 2018-04-02 23:21:13

角5快出来了。我可以想象,TOH并没有完全赶上。您可以通过https://github.com/dart-lang/site-webdev.git查看已知的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49614597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档