glimmerjs / glimmer-application

[MOVED] This package is now part of the Glimmer.js monorepo
https://github.com/glimmerjs/glimmer.js
30 stars 13 forks source link

Sourcemaps seem to have issues #56

Closed wycats closed 6 years ago

wycats commented 7 years ago

A number of people have reported problems with source maps, and many contributors have experienced the problem.

If you experience issues, please reply to this issue with more information. The more the better at this point.

mattmarcum commented 7 years ago

Out of the box I can't set breakpoints in the typescript sourcemaps that ship with the build. When I try to go to app.js and set a breakpoint there, chrome tries to redirect to the right sourcemap but usually I end up in component-manager.ts.

I turned off inlineSoureces and inlineSourceMap in tsconfig.json and can now set breakpoints in the compiled js output, unfortunately it doesn't look like they get triggered.

e00dan commented 7 years ago

When I put debugger in Typescript code - Chrome stops execution of code, but, it highlights wrong line of code (not the one with debugger statement in it). Sourcemaps are inaccurate which makes line-by-line debugging impossible. I can only use console to debug my code and look into an IDE to see where I really am (instead of looking at Chrome debugger). It's crucial for development workflow to have accurate sourcemaps. :)

peabnuts123 commented 6 years ago

I assume this is well-known but just to add my two-cents, I can confirm that sourcemaps seem to be completely inoperational. Upon generating a new glimmer project and inspecting the default component only some lines can have breakpoints added to them.

image

See that in my small example app (displaying a list of "car" objects) I can only put breakpoints on lines 16, 25, 26, 32, 33, 35, 39, 43 and 48. Changing inlineSourceMap to false in tsconfig.json does not change anything.

image

Subsequently, if I actually put a breakpoint somewhere in this, it does not seem to correspond to the correct symbols in the source file. For example, in this screenshot you can see that the variable stringLength is undefined despite the right-hand-side always returning a number.

I assume this is mostly TypeScript's doing, as interfaces and the like are entirely used for compilation purposes and do not represent any real code upon being emitted.

locks commented 6 years ago

This repo has been merged with glimmerjs/glimmer.js (into a monorepo setup). I am not sure if this issue is still applicable, but if you could confirm it is still an ongoing concern and open it over there that would be very helpful.

Sorry for the noise, but thank you for your help!