Sketch-sh/sketch-sh

[beta.sketch.sh] Dep resolver doesn't work in Safari

jchavarri opened this issue · 1 comments

When opening https://beta.sketch.sh/ in Safari the console shows:

ApiErrorJson:
Url: https://data.jsdelivr.com/v1/package/resolve/npm/@
{"status":400,"message":"Bad Request. Visit
https://github.com/jsdelivr/data.jsdelivr.com for documentation."}

I tracked this down to an issue with how Url objects are handled in different browsers. It seems that Safari doesn't put in url.pathname the same data as Chrome or Firefox in this line:

let pathname = parsed_url->Webapi.Url.pathname->normalize_pathname;

Small repro: https://codesandbox.io/s/cocky-satoshi-u3kux

Fixed in 17bad66