Dart2JS cannot find WebStorm import packages
I am using WebStorm 8 IDE to create a web darter application. I have the following directory structure:
root web main.dart lib packages browser intl intl.dart pubspec.lock pubspec.yaml
I have the following import status:
However, when I try to compile
dart2js Error occurred: /Path/To/Project/root/web/main.dart:2:8: Error: Can't read 'package:intl/intl.dart' (Error reading '/Path/To/Project/root/web/packages/intl/intl.dart' (OS Error: No such file or directory, errno = 2)). import "package:../packages/intl/intl.dart"; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: Compilation failed.
So it seems that dart2js is looking at the current directory of the dart file to be converted for packages, which is not correct.
I tried to change my import statement to
, but I got the same error.
Does anyone have any ideas?
I can use
to build my project and build
. Not sure what happens when I call the assembly, maybe there is something wrong with the WebStorm?
source to share