Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 加载包失败-省道角度教程_Dart_Angular Dart - Fatal编程技术网

Dart 加载包失败-省道角度教程

Dart 加载包失败-省道角度教程,dart,angular-dart,Dart,Angular Dart,我试着按照我的教程。 在我进入导航章节之前,一切都很顺利。 当我使用webstorm和chromium运行项目时,我总是会遇到这个错误。 我还试图运行,但我得到了相同的错误。 似乎这些包浏览器/角度等未加载。 也许webstorm有一些限制?!有趣的是,它在第一次运行时偶尔会起作用,但当我在浏览器中刷新页面时,错误总是再次出现 http://localhost:63342/toh-5-master/web/packages/browser/dart.js Failed to load resou

我试着按照我的教程。 在我进入导航章节之前,一切都很顺利。 当我使用webstorm和chromium运行项目时,我总是会遇到这个错误。 我还试图运行,但我得到了相同的错误。 似乎这些包浏览器/角度等未加载。 也许webstorm有一些限制?!有趣的是,它在第一次运行时偶尔会起作用,但当我在浏览器中刷新页面时,错误总是再次出现

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
编辑 由于我改为本回购协议,上述措施现在起作用了: 它与Dart 2一起工作

现在我对新的5-dev回购协议有另一个问题。 这是我的酒吧服务控制台。它表示缺少main.template.dart。 (我使用的是Dart版本2.0.0-dev.44.0。

有人知道如何解决这个问题吗

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

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

角5快出局了。我可以想象,托赫还没有赶上。您可以查看以查看已知问题。

Angular 5即将出局。我可以想象,托赫还没有赶上。您可以查看以查看已知问题。

对于Angular 4示例应用程序

如果应用程序中出现错误,导致dart2js无法成功编译,则可能会发生类似的加载失败。在WebStorm的发布服务选项卡中,发布是否报告了任何错误或警告?还要确保您使用的是Dart SDK的版本1.24.3

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

对于Angular 5个示例应用程序

正如您所发现的,如果您想尝试使用Angular 5-alpha的示例,请切换到repo的
5-dev
分支。确保您使用的SDK版本至少为Dart 2-dev

Dart 2 SDK不再支持
pub build
pub service
。截至2018年第二季度,您无法使用WebStorm构建和服务Angular 5应用程序。相反,您需要从命令行执行此操作:

pub-run-build\u-runner-service

然后在Chrome中打开
localhost:8080

有关Angular 4示例应用程序的完整详细信息,请参见Angular 5。

如果应用程序中出现错误,导致dart2js无法成功编译,则可能会发生类似的加载失败。在WebStorm的发布服务选项卡中,发布是否报告了任何错误或警告?还要确保您使用的是Dart SDK的版本1.24.3

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

对于Angular 5个示例应用程序

正如您所发现的,如果您想尝试使用Angular 5-alpha的示例,请切换到repo的
5-dev
分支。确保您使用的SDK版本至少为Dart 2-dev

Dart 2 SDK不再支持
pub build
pub service
。截至2018年第二季度,您无法使用WebStorm构建和服务Angular 5应用程序。相反,您需要从命令行执行此操作:

pub-run-build\u-runner-service

然后在Chrome中打开
localhost:8080

有关完整的详细信息,请参阅Angular 5。

关于Dart2迁移,我发现还有另一个版本,因此教程就像您所说的那样非常流行。我将在这里尝试这个版本:在Dart2迁移中,我发现还有另一个版本,所以教程就像您所说的一样。我将在这里尝试这个版本:我下载了Dart 2.0.0-dev.42.0,并将我的发布服务器选项卡作为edit发布在最初的帖子中。我总是收到一个错误,页面加载器不是真正的路径。我在这个路径中查找“examples/util/pageloader”不存在。正在解析依赖项。。。第1行第1列出现错误:缺少必需的“名称”字段。现在您已经切换到Angular 5示例,我也更新了答案以涵盖该字段。我能够从示例repo中构建和服务5-dev-toh-5应用程序,没有任何问题。如果您仍然有问题,请告诉我。我已下载了Dart 2.0.0-dev.42.0,并将我的发布服务器选项卡作为EDIT发布在最初的帖子中。我总是收到一个错误,页面加载器不是真正的路径。我在这个路径中查找“examples/util/pageloader”不存在。正在解析依赖项。。。第1行第1列出现错误:缺少必需的“名称”字段。现在您已经切换到Angular 5示例,我也更新了答案以涵盖该字段。我能够从示例repo中构建和服务5-dev-toh-5应用程序,没有任何问题。如果你还有问题,请告诉我。