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

dist/ember.prod.js has multiple sourcemap declarations, breaking sourcemap build #16881

Closed
kmoe opened this issue Aug 13, 2018 · 4 comments · Fixed by #17128
Closed

dist/ember.prod.js has multiple sourcemap declarations, breaking sourcemap build #16881

kmoe opened this issue Aug 13, 2018 · 4 comments · Fixed by #17128

Comments

@kmoe
Copy link

kmoe commented Aug 13, 2018

Summary

The current npm version of ember-source, 3.3.1 (2018-09-07 update: issue remains in 3.4.0), contains the file dist/ember.prod.js. This file contains multiple declarations of the form:

    //# sourceMappingURL=FILENAME.js.map

According to the source map spec, there should only be one line of this form, at the end of the file.

Impact

This means any vendor.js file built with ember-cli will not have a valid sourcemap file.

Please see #16844 for the error (the bug was erroneously closed as the issue was assumed to be with ember-cli, not ember-source).

Cause

Including multiple sourceMappingURL declarations in ember.prod.js causes issues for fast-sourcemap-concat (/lib/source-map.js#L91), since the source-map-url library only removes the first one.

This is valid behaviour since there should only be one sourceMappingURL declaration per file.

Suggested fix

Remove the extra sourceMappingURL lines from dist/ember.prod.js.

References and similar issues

broccolijs/broccoli-concat#123
ef4/fast-sourcemap-concat#54
ember-cli/ember-fetch#120

@kmoe kmoe changed the title dist/ember.prod.js has multiple sourcemap declarations, breaking vendor.map build dist/ember.prod.js has multiple sourcemap declarations, breaking sourcemap build Aug 13, 2018
@buschtoens
Copy link
Contributor

Downgrading to v3.2.2 fixes this. v3.3.0-beta.2, the first version on npm after v3.2.2, already exhibits the bug. So it happened somewhere between v3.2.2...v3.3.0-beta.2.

@buschtoens
Copy link
Contributor

buschtoens commented Oct 15, 2018

Bug is still present in latest v3.6.0-beta.1 release. Just search for sourceMappingURL in https://unpkg.com/ember-source@3.6.0-beta.1/dist/ember.prod.js for reproduction.

This effectively prevents us from upgrading, because our Sentry stack traces for vendor.js are unparseable. I would love to help fix this, but I know too little about Ember's internal build pipeline. If I could get some pointers of potential sites of interest, I'll start investigating. 🕵️

@Turbo87
Copy link
Member

Turbo87 commented Oct 18, 2018

0af6791 is the first bad commit
commit 0af6791
Author: Robert Jackson rjackson@linkedin.com
Date: Thu Apr 12 13:20:38 2018 -0400

Move error handling code up into standalone package.

This simplifies a possible cycle between ember-metal and @ember/runloop.

Also migrate to typescript...

@Turbo87
Copy link
Member

Turbo87 commented Oct 18, 2018

a day earlier #16482 was merged, which is likely the actual cause of this issue 🤔

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

Successfully merging a pull request may close this issue.

4 participants