Reputation: 3399
When I try to import a package with the syntax import 'package:markdown/markdown.dart';
, I get no error in Dart Editor but when I run the dart application, the debugger shows me the message:
An error occurred loading file: package:markdown/markdown.dart
Failed to load resource
chrome-extension://gfjabgeipkcfopofkhjimepepnomcidk/dart/packages/markdown/markdown.dart
But when I write the whole path (import "../../packages/markdown/markdown.dart";
) everything works fine. I cannot understand why the syntax package:
doesn't work in my code though it works in Dart Editor's own examples.
You can see the Chrome app architecture below (I'm loading a package from translator.dart
):
Upvotes: 0
Views: 844
Reputation: 15906
You should have the package added as a dependency in pubspec.yaml (which I assume you do).
Also try running following:
Upvotes: 1
Reputation: 1069
I think in your md_to_html folder you need a link to the 'packages' directory for the shortform to work. I seem to remember this happening when the workspace is built but I'm not sure now which command triggers it, have a look at the current pub docs.
Upvotes: 0