this post was submitted on 14 Oct 2023
1066 points (97.0% liked)

Programmer Humor

32000 readers
1744 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 11 months ago (2 children)

Sourcemaps. Use sourcemaps.

[–] [email protected] 60 points 11 months ago (1 children)
[–] [email protected] 13 points 11 months ago (1 children)
[–] [email protected] 10 points 11 months ago (2 children)

The hostage has been planted.

[–] [email protected] 5 points 11 months ago (2 children)
[–] [email protected] 2 points 11 months ago (1 children)
[–] [email protected] 4 points 11 months ago

No that's coming in CS2: Siege

[–] [email protected] 1 points 11 months ago

FUSE has entered the chat.

[–] [email protected] 2 points 11 months ago
[–] [email protected] 6 points 11 months ago (1 children)

Can you give us an eli5 on sourcemaps?

[–] [email protected] 7 points 11 months ago (1 children)

Usually when code is minified, it is shipped alongside a sourcemap (*.js.map), which can be used by the browser to show you the original code.

If you get an error in the browser, you can click the error, which will take you to the network(?) tab and show you exactly where the error occurred

[–] [email protected] 5 points 11 months ago (1 children)

Also when code has been compiled, or transpiled. The reason the line numbers don't match is because all of the code is being assembled into one large package and served to whatever client uses it. So even if you don't minify, but you're compiling, sourcemaps will show you where the error actually occurs, instead of where it occurs in the finished product.

[–] [email protected] 1 points 11 months ago

Especially if the compiler optimization options inlined code from 5 different places into one blob