尝试在我的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/