Cannot find referenced source: packages

前端 未结 5 617
我寻月下人不归
我寻月下人不归 2021-01-13 14:10

I have this pubspec.yaml

    name: Dart Pages
    description: The Dart platform.
    dependencies:
      web_compon         


        
5条回答
  •  广开言路
    2021-01-13 14:47

    Have you run pub install since you created the "web" directory? If not, try that. You need to have a "packages" directory inside the directory that contains your Dart entrypoint in order for "package:" imports to resolve correctly.

    Pub will create those directories for you, but it needs to know to do that. If you add a new directory to your package, you'll want to run pub install again so it add a "packages" directory to it.

提交回复
热议问题