Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid format exception on webdev serve #1499

Open
themisir opened this issue Feb 11, 2022 · 4 comments
Open

Invalid format exception on webdev serve #1499

themisir opened this issue Feb 11, 2022 · 4 comments
Assignees
Labels
P3 A lower priority bug or feature request triaged

Comments

@themisir
Copy link

themisir commented Feb 11, 2022

I was trying out dart webdev tool with dart create "web-simple" template. I created a new project using dart create . -t web-simple then used webdev serve to start development server.

When I tried to access preview url I got this error on console:

FormatException: Scheme not starting with alphabetic character (at character 1)
@http://127.0.0.1:8080/main.dart.bootstrap.js
^
The whole terminal output
❯ webdev serve
[INFO] Reading cached asset graph completed, took 206ms
[INFO] Checking for updates since last build completed, took 501ms
[INFO] Serving `web` on http://127.0.0.1:8080
[INFO] Running build completed, took 124ms
[INFO] Caching finalized dependency graph completed, took 165ms
[INFO] Succeeded after 296ms with 0 outputs (0 actions)
[INFO] --------------------------------------------------------------------------------------------
ERROR - 2022-02-11 16:52:03.661574
GET /@http://127.0.0.1:8080/main.dart.bootstrap.js
Error thrown by handler.
FormatException: Scheme not starting with alphabetic character (at character 1)
@http://127.0.0.1:8080/main.dart.bootstrap.js
^

dart:core                                          _SimpleUri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28         proxyHandler.<fn>
package:shelf_proxy/shelf_proxy.dart 37:10         proxyHandler.<fn>
package:shelf/src/cascade.dart 77:53               Cascade.handler.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 74:34                  serveRequests.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 73:3                   serveRequests
package:webdev/src/util.dart 24:5                  serveHttpRequests.<fn>
package:stack_trace                                Chain.capture
package:webdev/src/util.dart 23:16                 serveHttpRequests
package:webdev/src/serve/webdev_server.dart 185:5  WebDevServer.start

ERROR - 2022-02-11 16:52:19.133559
GET /@http://127.0.0.1:8080/main.dart.bootstrap.js
Error thrown by handler.
FormatException: Scheme not starting with alphabetic character (at character 1)
@http://127.0.0.1:8080/main.dart.bootstrap.js
^

dart:core                                          _SimpleUri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28         proxyHandler.<fn>
package:shelf_proxy/shelf_proxy.dart 37:10         proxyHandler.<fn>
package:shelf/src/cascade.dart 77:53               Cascade.handler.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 74:34                  serveRequests.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 73:3                   serveRequests
package:webdev/src/util.dart 24:5                  serveHttpRequests.<fn>
package:stack_trace                                Chain.capture
package:webdev/src/util.dart 23:16                 serveHttpRequests
package:webdev/src/serve/webdev_server.dart 185:5  WebDevServer.start

If you don't have bandwidth to handle this issue, I would be happy to look into it, I would just need some pointers to know where to start.

@Mogyuchi
Copy link

Mogyuchi commented Mar 7, 2022

@themisir Are you using Safari?
If you use another browser, you won't get an error.

I tried

  • ⭕ Chromium 98.0.4758.102 snap, Mozilla Firefox 97.0 [Ubuntu 21.10 aarch64]
  • ⭕ Chromium Version 101.0.4918.0 (Developer Build) (x86_64) Firefox 97.0.2 (64-bit) [macOS Monterey Version 12.3 Beta (21E5227a) (Intel)]
  • ❌ Safari Version 15.4 (17613.1.17.1.6) [macOS Monterey Version 12.3 Beta (21E5227a) (Intel)]
  • ❌ iPadOS 15.3.1 (Safari etc...)

@GZGavinZhao
Copy link

GZGavinZhao commented Jan 15, 2023

Still happens here. I'm on M1 macOS Monterey 12.3.1, Safari 15.4, Dart 2.18.6, and webdev 2.7.11. When creating a project using dart create -t web, the same format exception is thrown only on Safari:

[INFO] Building new asset graph completed, took 2.0s
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[INFO] Serving `web` on http://127.0.0.1:8080
[INFO] Generating SDK summary completed, took 2.2s
[INFO] Running build completed, took 32.1s
[INFO] Caching finalized dependency graph completed, took 515ms
[INFO] Succeeded after 32.6s with 7160 outputs (14546 actions)
[INFO] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR - 2023-01-14 20:56:12.497063
GET /@http://localhost:8080/main.dart.bootstrap.js
Error thrown by handler.
FormatException: Scheme not starting with alphabetic character (at character 1)
@http://localhost:8080/main.dart.bootstrap.js
^

dart:core                                          _Uri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28         proxyHandler.<fn>
package:shelf/src/cascade.dart 77:53               Cascade.handler.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 91:9                   serveRequests.<fn>.<fn>
===== asynchronous gap ===========================
package:shelf/shelf_io.dart 89:3                   serveRequests
package:webdev/src/util.dart 24:5                  serveHttpRequests.<fn>
package:stack_trace                                Chain.capture
package:webdev/src/util.dart 23:16                 serveHttpRequests
package:webdev/src/serve/webdev_server.dart 184:5  WebDevServer.start

@GZGavinZhao
Copy link

Adding on to it, this seems like a problem by dartdevc instead of webdev, because if I use webdev serve --release to force webdev to use dart2js, the problem goes away.

Additionally, if I do webdev build --no-release to force using dartdevc and then serve the files directly (e.g. dhttpd --path=build), the same error occurs:

> dhttpd --path=build
Server started on port 8080
2023-01-14T21:07:00.956095  0:00:00.007707 GET     [200] /
2023-01-14T21:07:00.977470  0:00:00.000474 GET     [200] /styles.css
2023-01-14T21:07:00.979183  0:00:00.000238 GET     [200] /main.dart.js
2023-01-14T21:07:00.984345  0:00:00.000344 GET     [200] /packages/build_web_compilers/src/dev_compiler/require.js
2023-01-14T21:07:00.985562  0:00:00.000261 GET     [200] /packages/build_web_compilers/src/dev_compiler_stack_trace/stack_trace_mapper.dart.js
2023-01-14T21:07:00.998798  0:00:00.000924 GET     [404] /@http://localhost:8080/main.dart.bootstrap.js
2023-01-14T21:07:01.426363  0:00:00.010799 GET     [304] /
2023-01-14T21:07:01.441603  0:00:00.000494 GET     [304] /styles.css
2023-01-14T21:07:01.442997  0:00:00.000385 GET     [304] /main.dart.js
2023-01-14T21:07:01.446858  0:00:00.000539 GET     [304] /packages/build_web_compilers/src/dev_compiler_stack_trace/stack_trace_mapper.dart.js
2023-01-14T21:07:01.448434  0:00:00.000446 GET     [304] /packages/build_web_compilers/src/dev_compiler/require.js
2023-01-14T21:07:01.459252  0:00:00.000180 GET     [404] /@http://localhost:8080/main.dart.bootstrap.js
2023-01-14T21:07:02.369460  0:00:00.000511 GET     [304] /
2023-01-14T21:07:02.373869  0:00:00.000524 GET     [304] /styles.css
2023-01-14T21:07:02.375522  0:00:00.000451 GET     [304] /main.dart.js
2023-01-14T21:07:02.378332  0:00:00.000585 GET     [304] /packages/build_web_compilers/src/dev_compiler/require.js
2023-01-14T21:07:02.380013  0:00:00.000452 GET     [304] /packages/build_web_compilers/src/dev_compiler_stack_trace/stack_trace_mapper.dart.js
2023-01-14T21:07:02.389053  0:00:00.000167 GET     [404] /@http://localhost:8080/main.dart.bootstrap.js

@bkonyi
Copy link
Collaborator

bkonyi commented Dec 4, 2024

@jyameo can you verify if this is still an issue or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request triaged
Projects
None yet
Development

No branches or pull requests

5 participants