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

NB: Sourcemaps from chrome-extension:// URLs don't load #21

Open
vkz opened this issue Jul 25, 2021 · 3 comments
Open

NB: Sourcemaps from chrome-extension:// URLs don't load #21

vkz opened this issue Jul 25, 2021 · 3 comments

Comments

@vkz
Copy link

vkz commented Jul 25, 2021

This is more of a heads up for anyone attempting to write extensions in ClojureScript. Your sourcemaps, although correctly generated and present won't load. Will manifest as Warnings in Console that print URL path to respective source map with 404 and ERR_UNRECOGNIZED_URL. Ironically, you can click said link and happily navigate to the sourcemap.

Actual issue has been open with Chrome devs for quite some time now, but sadly gets completely drowned by noise when you try to Google it. Link to Chrome Bug tracker.

Every existing Chrome build (including Canary) is effected. Discussion in chromium-review mentioned a solution which someone may attempt to build from source, but the latest comment (late June 2021) marks solution as abandoned in favor of yet to be revealed one. Issue remains outstanding since at least Feb 2020, so don't hold your breath.

FWIW sourcemaps for extensions work just fine in Firefox, and in fact you should be able to load chromex examples as is. That said any code in Chromex or CLJS WebTools that touches custom Chrome APIs won't run. E.g. custom formatters and some (maybe all) stuff under chrome.runtime e.g. chrome.runtime.onSuspendCanceled

Honestly, I think Chrome devs dropped the ball big time on this one, since this probably effects any "compiles to JS" language out there including TypeScript.

@kzar
Copy link

kzar commented Jul 26, 2021

I don't use chromex (yet) but I am an extension developer. Anyway, I just wanted to say that inline source-maps (where the mapping is a large comment at end of JavaScript files) do work. You might want to pursue using those, at least in development, until the linked bug's fixed in Chromium.

@vkz
Copy link
Author

vkz commented Jul 26, 2021

Good point. I'll need to figure out who in the pipeline is responsible for sourcemap generation and switch it over to inline maps. Wish CLJS compiler could do the trick. Related issues found:

@darwin
Copy link
Member

darwin commented Aug 31, 2021

I also made some effort to implement inline source maps in CLJS compiler:
https://clojure.atlassian.net/browse/CLJS-1902

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

No branches or pull requests

3 participants