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
Source map lines wrong after some time #871
Comments
No clue, more information and a reproducible example would help. |
I've finally managed to reproduce this. I took a
and
I've added this code to fail: With the boot dev server I see: Note that boot jumps to line 6, which is correct, but shadow jumps to line 8. I've looked at the source maps and decoded them. For boot, download http://localhost:3000/main.out/app/core.js.map and:
for shadow-cljs
So my understanding is that there's the generated JS file, and on line X at column Y of it some error happens, in the boot case something like X = 6, Y = 16, then it looks up the entries for line 6 in the mappings, and in there finds the closest column entry <= 16 (guessing on the exact operation), which then points to "core.cljs 6:7 clojure.string/replace". But in my shadow-cljs generated source-maps all the columns are mapped to "1", so it jumps to the last one in that chunk. Which in MANY cases still will be the correct line, perhaps even roughly the same column, which is why it isn't noticeable in many situations. I've used shadow-cljs 2.12.6 in the example and various older shadow-cljs versions I tried (back to 2.8.x). |
Please upgrade the boot example to use CLJS 1.10.844. It is using completely ancient versions. I don't even know how far back you'd have to go with shadow-cljs to get those versions but I think it was still 1.x era.
Also what is the |
Also the example code produces 3 warnings? One cannot expect proper source maps for improper code?
|
The boot dependencies are upgraded. |
Warnings are fixed now. |
Found some old compiler hack code that got out of sync with CLJS. Should be fixed in Thanks for the repro. |
Awesome, just tried it and all's well. |
Something that I've noticed for quite a while in ShadowCLJS is that the reported source code line numbers in the browser console (e.g., in case of exceptions thrown in the browser) are getting offset after a couple of hot reloading modifications. When I then refresh the browser, the problem is solved.
I do not seem to find anything about this issue in the manual or the Github issues. Am I the only one encountering it?
The text was updated successfully, but these errors were encountered: