【问题标题】:PWA Worker throws an error with AngularDartPWA Worker 使用 AngularDart 引发错误
【发布时间】:2017-08-28 09:14:55
【问题描述】:

我正在尝试向 angular dart 项目添加离线功能,运行 pub build 但是

Running pub build:pub.exe build
-----
Unhandled exception:
ProcessException: The system cannot find the file specified.
Command: pub.exe build
#0      _buildProjectIfEmptyOrOld (http://localhost:52940/pwa.dart:116)
<asynchronous suspension>
#1      main (http://localhost:52940/pwa.dart:40)
<asynchronous suspension>
#2      _startIsolate.<anonymous closure> (dart:isolate-
patch/isolate_patch.dart:263)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-
patch/isolate_patch.dart:151)

main.dart

import 'package:angular/angular.dart';
import 'package:my_app/views/app_component/app_component.dart';
import 'package:pwa/client.dart' as pwa;

void main() {
    bootstrap(AppComponent);

    // register PWA ServiceWorker for offline caching.
    new pwa.Client();
}

pubspec.yaml

dependencies:
     pwa: ^0.1.2

【问题讨论】:

标签: dart service-worker angular-dart dart-pub


【解决方案1】:

此时,pwa 正在尝试运行 pub.exe build。我还没有在 Windows 上尝试过,只有一个朋友报告它可以工作,但 pub.exe 完全有可能不再工作(如果它曾经工作过),它应该一直是 pub(在这个如果是与 Windows 相关的错误)。

建议的解决方法:

  • 运行pub build
  • 运行pub run pwa
  • 再次运行pub build

如果上述方法有效,请告诉我,我会在补丁版本中修复它。

【讨论】:

  • 是的,错误仍然存​​在,同时运行 pub run pwa
  • 在 windows 上运行 pub run pwa 时,依赖更新 pwa 0.1.7 中仍然存在错误。
猜你喜欢
  • 2018-02-13
  • 1970-01-01
  • 2015-02-24
  • 2018-09-29
  • 2019-01-08
  • 1970-01-01
  • 2023-03-16
  • 2020-11-20
  • 1970-01-01
相关资源
最近更新 更多