dart-lang / dart-lang/webdev

Webdev serve fails when launched from a Github Codespace

Open
#1,953 0 comments 0 reactions 0 assignees View on GitHub
P3 package:webdev triaged
Dominant language
Dart
Stars
224
Forks
94
Avg merge
4d 3h
Merged PRs (30d)
2

Description

To reproduce:

1. Create a new Github Codespace
2. Configure codespace to use the Dart community configuration
3. Add webdev dependencies and install webdev tools in codespace
4. Create a new project using the Dart create -t web template
5. Run webdev serve
6. Open webapp in browser via the forwarded port
7. Dev server crashes with a message similar to this:

```
ERROR - 2023-02-12 14:34:40.430078
GET /@https://xxxxxxxxxxxx-sturdy-meme-ggxggwwwv7fwxj-8080.preview.app.github.dev/main.dart.bootstrap.js
Error thrown by handler.
FormatException: Scheme not starting with alphabetic character (at character 1)
@https://xxxxxxxxxxxx-sturdy-meme-ggxggwwwv7fwxj-8080.preview.app.github.dev/ma...
^

dart:core _SimpleUri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28 proxyHandler.
package:shelf/src/cascade.dart 77:53 Cascade.handler..
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 91:9 serveRequests..
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 89:3 serveRequests
package:webdev/src/util.dart 22:5 serveHttpRequests.
package:stack_trace Chain.capture
package:webdev/src/util.dart 21:16 serveHttpRequests
package:webdev/src/serve/webdev_server.dart 181:5 WebDevServer.start
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in a GitHub Codespace using the Dart community configuration and the web template, then inspect package:shelf_proxy/shelf_proxy.dart at line 42 and webdev/src/util.dart and webdev/src/serve/webdev_server.dart around the cited stack frames. Done means webdev serve remains running and the app loads through the forwarded port without the malformed URL FormatException.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, github
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.