Problem with Safari Browser: FormatException: Scheme not starting with alphabetic character (at character 1)
I started with the quick start guide on https://docs.page/schultek/jaspr/quick-start. I created a project using the basic template, entered the working directory and ran the serve command. I did not open the project in an IDE or edited any files.
When the page is up, I open the browser and visit localhost:8080. I see a white page with »Hello World«, but an error gets logged on the server. It seems as if there is an @ symbol in front of the scheme in the generated code.
FormatException: Scheme not starting with alphabetic character (at character 1)
ERROR - 2023-03-31 17:36:08.922166
GET /@http://localhost:8080/app.app.dart.bootstrap.js
Error thrown by handler.
FormatException: Scheme not starting with alphabetic character (at character 1)
@http://localhost:8080/app.app.dart.bootstrap.js
^
dart:core _SimpleUri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28 proxyHandler.<fn>
package:jaspr/src/server/server_handler.dart 51:28 _webdevProxyHandler.<fn>
package:jaspr/src/server/server_handler.dart 34:55 RefreshableHandler.call
package:shelf_gzip/src/gzip_encoding.dart 44:44 createGzipMiddleware.<fn>.<fn>.<fn>
dart:async new Future.sync
package:shelf_gzip/src/gzip_encoding.dart 44:21 createGzipMiddleware.<fn>.<fn>
This is my pubspec.yaml:
name: jaspr_website
description: A basic pure-dart web app with ssr & automatic client hydration.
version: 0.0.1
environment:
sdk: '>=2.17.0 <3.0.0'
dependencies:
jaspr: ^0.2.0+4
dev_dependencies:
build_runner: ^2.2.0
build_web_compilers: ^3.2.1
jaspr_builder: ^0.2.0
lints: ^2.0.1
jaspr --version returns 0.1.0
dart --version returns Dart SDK version: 2.19.6 (stable)
I am using Safari on macOS.

UPDATE: This issue does not occur using Chrome.
Seems to be a webdev issue on Safari.
Reproducible through:
dart create -t web safari_test
cd safari_test
webdev serve
Please open an issue on the webdev repo: https://github.com/dart-lang/webdev
Please open an issue on the webdev repo: https://github.com/dart-lang/webdev
I just found out, there is an existing issue at the webdev repo, already: https://github.com/dart-lang/webdev/issues/1499
Interesting note from the linked dart-lang/webdev issue:
Adding on to it, this seems like a problem by
dartdevcinstead ofwebdev, because if I usewebdev serve --releaseto forcewebdevto usedart2js, the problem goes away.
https://github.com/dart-lang/webdev/issues/1499#issuecomment-1383025694
@schultek I take this to mean that when deployed, there will not be any Safari related issues. This issue crops up just for local development. If so, I do not think this is too pressing... as long as it works in production.
I have yet to publish any jaspr apps so I havent confirmed, but that seems to be the case: https://jasprpad.schultek.de/ runs fine on Safari on MacOS.
Yes from my testing also this only affects dev mode.
@schultek From yesterday it affects all web browsers. Auto refresh doesn't work at all.
After reading the below issue I found a solution on how to be able to test on Safari
https://github.com/dart-lang/webdev/issues/1499#issuecomment-1383025694
jaspr server --release