I am trying to add offline capabilities to an angular dart project, running pub build
but
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
At that point, the
pwa
is trying to runpub.exe build
. I haven't tried it on Windows, only a friend reported it working, but it is entirely possible thatpub.exe
does no longer work (if it ever did), and it should have beenpub
all along (and in this case it is a Windows-related bug).Suggested workaround:
pub build
pub run pwa
pub build
againIf the above works, let me know, and I'll fix it in a patch release.