jaspr icon indicating copy to clipboard operation
jaspr copied to clipboard

feat: Improve error message when running dev build on Safari

Open nikodembernat opened this issue 4 months ago • 1 comments

Description

Currently, when you create a new Jaspr project and try to open it in Safari you get either a blank screen, or a hello world app (counter app) that doesn't react to user interactions.

Moreover, in the console you can see errors like this:

ERROR - 2025-08-14 17:05:14.274872
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                                              _SimpleUri.resolve
package:shelf_proxy/shelf_proxy.dart 42:28             proxyHandler.<fn>
package:jaspr_cli/src/helpers/proxy_helper.dart 40:36  ProxyHelper.startProxy.<fn>

It's a known issue (https://github.com/schultek/jaspr/issues/58, https://github.com/dart-lang/webdev/issues/1499), but from a perspective of a first-time Jaspr user quite a bad experience nonetheless.

Proposal

My proposal is to show an additional error message describing this issue, and to recommend developing the app in Chrome. Something like:

[...]
package:shelf_proxy/shelf_proxy.dart 42:28             proxyHandler.<fn>
package:jaspr_cli/src/helpers/proxy_helper.dart 40:36  ProxyHelper.startProxy.<fn>

[WARNING] Launching debug builds in Safari is not supported for Dart web 
applications due to a known bug. 

See the following issues for more information:
- https://github.com/dart-lang/webdev/issues/1499
- https://github.com/schultek/jaspr/issues/58

nikodembernat avatar Aug 14 '25 15:08 nikodembernat

Good idea, it seems like this issue won't be fixed anytime soon in the sdk.

I need to check how I can detect this / if a user is using safari.

schultek avatar Aug 14 '25 16:08 schultek