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

Update CDN map URL #1671

Closed
twalve opened this issue Apr 16, 2018 · 2 comments
Closed

Update CDN map URL #1671

twalve opened this issue Apr 16, 2018 · 2 comments
Labels

Comments

@twalve
Copy link

twalve commented Apr 16, 2018

It was reported in #1188 that a change at the CDN had required an alteration of the CDN URI, and that change has been made, and the issue closed. GREAT work!

I think there's a further requirement and that's to alter the map URI to expand the minified file contents.

While the CDN file loads without issue, https://cdn.jsdelivr.net/npm/hls.js@latest, the .map file 404s:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (hls.min.js.map, line 0)

The URI being called by the file is https://cdn.jsdelivr.net/npm/hls.min.js.map, which would have related to the old minified source

It's the last line in the file as:
//# sourceMappingURL=hls.min.js.map

When using the Cloudflare URI as the CDN, there's no issue, as it supplies hls.min.js.map.
When using the reference application there's no issue as the files are sourced from a CDN.

@MartinKolarik
Copy link

The problem here lies in using the short version of the url. https://cdn.jsdelivr.net/npm/hls.js@latest is just a shorter and "nicer" url for https://cdn.jsdelivr.net/npm/hls.js@latest/dist/hls.min.js.

Many people prefer leaving out the file path, but it breaks source maps and other relative imports because browsers resolve the relative url as https://cdn.jsdelivr.net/npm/hls.min.js.map instead of https://cdn.jsdelivr.net/npm/hls.js@latest/dist/hls.min.js.map. Unfortunately, there isn't an easy solution for us to fix this at the CDN level, which is why jsDelivr doesn't recommend using the short links.

@stale
Copy link

stale bot commented Jun 15, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants