dart - 要求页面时“pub serve test”引发错误

标签 dart

尝试在我的dart项目中运行pub serve test会收到以下消息:

Loading source assets...
Loading dart_to_js_script_rewriter transformers...
Serving mud test on http://localhost:8080
Build completed successfully

但是,当我加载http://localhost:8080时,我得到以下消息:
[test] GET  → Could not find asset mud|test.

这是我的目录结构:
.
├── CHANGELOG.md
├── README.md
├── analysis_options.yaml
├── build
│   └── ...
├── lib
│   └── ...
├── pubspec.lock
├── pubspec.yaml
├── test
│   ├── browser_test.dart
│   ├── browser_test.html
│   └── encounter_test.dart
└── web
    ├── favicon.ico
    ├── index.html
    ├── main.dart
    └── styles.css

最佳答案

您是否尝试访问`http://localhost:8080/browser_test.html'?

列出目录时,pub serve确实会列出。除非存在index.html,否则您应该只获得404。

关于dart - 要求页面时“pub serve test”引发错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49376034/

相关文章:

flutter - 在charts_flutter中设置轴的最小和最大范围

flutter - 在DateTime中获取每个月的确切日期

flutter - 在空方法上调用了 '[]'方法。 flutter

Flutter - 如何创建圆形背景颜色?

dart - 如何使用流发送http响应

json - 如何在Dart/Flutter中映射和显示嵌套的JSON?

flutter - 如何在 flutter 中更改包名称?

dart - 在WebStorm 8中构建Chrome打包的应用程序

dart - 错误 : Target of URI doesn't exist: 'package:test/test.dart'

flutter - 如何分别为 Flutter web 和 mobile 添加包?