ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Source map warning in chrome and webkit when using CDN

Open owenpearson opened this issue 4 years ago • 5 comments

Since adding source maps to the library in 1.2.10 browsers will automatically try to get the source maps from the CDN. We either need to host the source maps and all the source code on the CDN or make it so that we only distribute files through the CDN without the //# sourceMappingURL=ably.min.js.map directive at the bottom of the file.

┆Issue is synchronized with this Jira Task by Unito

owenpearson avatar Jun 15 '21 11:06 owenpearson

(should also look to remove this directive from 1.2.10 on the CDN)

owenpearson avatar Jun 15 '21 11:06 owenpearson

This is a duplicate #191. @owenpearson I won't close this as this is synced with Jira. Can you please consolidate issues?

I saw this problem again today. We should just serve the sourcemaps, that's better for end users, and easily done in the publishing tools.

mattheworiordan avatar Dec 13 '21 18:12 mattheworiordan

I'll close this one anyway since I only opened this to track the dev tools error we were getting when I added source maps for all the bundles. I definitely intend to upload the sourcemaps to the CDN in the near future, we intend to move all of the deployment code from infrastructure in to this repo and make a CD workflow so will probably deal with this alongside that work.

owenpearson avatar Dec 14 '21 16:12 owenpearson

I'm still consistently seeing this issue in my product. Here is the only place the cdn is referenced and it has a version:

<script src="https://cdn.ably.com/lib/ably.min-1.js"></script>

One problem may be that ably.min-1.js still has the reference to //# sourceMappingURL=ably.min.js.map as the last line, and that might be what's failing. I also tried the ably.min-1.2.js file but that reference is still there, and it gives the same error.

I can find the map file for the -1 version: https://cdn.ably.com/lib/ably.min-1.js.map, and the -1.2 version: https://cdn.ably.com/lib/ably.min-1.2.js.map but it looks like the js files are still incorrectly referencing the unversioned map file. Also, there is a file https://cdn.ably.com/lib/ably.min-1.1.js available, but no https://cdn.ably.com/lib/ably.min-1.1.js.map (or the permissions aren't correct as it returns an access denied error).

alamaral avatar Jun 02 '22 20:06 alamaral

Hi @alamaral, thanks for reporting this. I'll reopen the issue and we'll look into it with priority.

owenpearson avatar Jun 06 '22 08:06 owenpearson