Is there a working example of ember with source maps?

I’ve searched high and low and only found discussions on the topic, but no solutions.

I want just the basic hello world example where I have a typescript component and when I look it up in chrome (or any other browser) devtools, I see my typescript code and can step through it. This works in every other framework I’ve used so far. I can’t even get my original javascript code to show up.

All of the suggestions, including but not limited to: babel: { sourceMaps: 'inline' } sourcemaps: { mapStyle: 'data' }, etc

don’t really seem to do anything. I’m new to Ember and so far, I’m not liking the debugging experience. :frowning:

You’re hitting this because upstream changes in babel have broken things.

The babel change was https://github.com/babel/babel/pull/15022. People who got broken by it reported [Bug]: Sourcempas now outputs helpers names additionally to input source names · Issue #15601 · babel/babel · GitHub, although babel maintainers don’t necessarily agree it’s a bug.

In our case it comes up because after babel transpiles each file, the bundling process in ember-cli goes to concatenate them together with fast-sourcemap-concat and that library validates each source map first and ignores ones that are broken. The new babel source maps get judged as broken because they include names in the source map that don’t appear in the authored source.

We’ll need to get Remove sourcemap validation by lNikolayl · Pull Request #72 · ef4/fast-sourcemap-concat · GitHub release to get this fixed. It may be worth backporting just this one change as a patch release so that it will get out automatically to everyone who needs it.

Please try regenerating your lock file, I pushed fast-sourcemap-concat 2.1.1 and it should fix this.

1 Like

Amazing! It works now! :open_mouth: You’re fantastic. Thank you!