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

Problem with Safari Browser: FormatException: Scheme not starting with alphabetic character (at character 1) #58

Open
timbrueckner opened this issue Mar 31, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@timbrueckner
Copy link

timbrueckner commented Mar 31, 2023

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.

image

UPDATE: This issue does not occur using Chrome.

@timbrueckner timbrueckner changed the title Problem following the Quick Start Guide: FormatException: Scheme not starting with alphabetic character (at character 1) Problem with Safari Browser: FormatException: Scheme not starting with alphabetic character (at character 1) Mar 31, 2023
@schultek
Copy link
Owner

schultek commented Apr 1, 2023

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

@schultek schultek added the bug Something isn't working label Apr 1, 2023
@timbrueckner
Copy link
Author

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: dart-lang/webdev#1499

@walsha2
Copy link
Contributor

walsha2 commented Mar 15, 2024

Interesting note from the linked dart-lang/webdev issue:

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.

dart-lang/webdev#1499 (comment)


@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.

@schultek
Copy link
Owner

Yes from my testing also this only affects dev mode.

@adriank
Copy link

adriank commented Sep 19, 2024

@schultek
From yesterday it affects all web browsers. Auto refresh doesn't work at all.

@MarkOSullivan94
Copy link
Contributor

After reading the below issue I found a solution on how to be able to test on Safari

dart-lang/webdev#1499 (comment)

jaspr server --release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
  NODES
COMMUNITY 2
Note 1
Project 7
USERS 1