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

Source map always blank #1

Closed
es128 opened this issue Sep 30, 2014 · 6 comments
Closed

Source map always blank #1

es128 opened this issue Sep 30, 2014 · 6 comments
Labels
Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@es128
Copy link
Member

es128 commented Sep 30, 2014

var to5 = require('6to5');
var result = to5.transform('let foo = {bar: "baz"};\n var {bar} = foo;', {filename:'foo.js',sourceMap: true});
var sourceMap = result.split('\n').splice(-2, 1)[0].slice(50);
console.log((new Buffer(sourceMap, 'base64')).toString());
// {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@sebmck
Copy link
Contributor

sebmck commented Oct 1, 2014

Fixed in 650ff2e. Also added support for sourceMapObject which will return an object with the code and map. Thanks!

@sebmck sebmck closed this as completed Oct 1, 2014
@es128
Copy link
Member Author

es128 commented Oct 1, 2014

Thanks, but it doesn't seem to actually be fixed yet. After the latest commits, running the same example I provided above (except now with sourceMapObject), the result is:

{ code: 'var bar;\n(function () {\n  var foo = { bar: \'baz\' };\n  bar = foo.bar;\n}());',
  map:
   { _file: undefined,
     _sourceRoot: null,
     _sources: { _array: [], _set: {} },
     _names: { _array: [], _set: {} },
     _mappings: [],
     _sourcesContents: { '$true': 'let foo = {bar: "baz"};\n var {bar} = foo;' } } }

@sebmck
Copy link
Contributor

sebmck commented Oct 1, 2014

Woops, sorry. 4aeb62b and d80eab4 should do it.

@jaydson
Copy link

jaydson commented Oct 9, 2014

I think this is not working yet.
I'm running 6to5 1.7.0 and the source map content generated is always: "[object Object]"

@sebmck
Copy link
Contributor

sebmck commented Oct 9, 2014

@jaydson An unintentional switch to recast changed from a SourceMapGenerator to an Object.

@es128
Copy link
Member Author

es128 commented Oct 9, 2014

@sebmck It's already fixed in grunt-6to5. Probably better for it to provide an object as it does now instead of a string.

@sebmck sebmck added the bug label Oct 11, 2014
@mattma mattma mentioned this issue Nov 23, 2014
sebmck pushed a commit that referenced this issue Jan 26, 2015
Updated minor version upgrade of corejs to fix firefox 20-23 issue
sebmck pushed a commit that referenced this issue Mar 16, 2015
sebmck pushed a commit that referenced this issue Mar 16, 2015
Enable native support for let/const in node v0.11.2+
sebmck pushed a commit that referenced this issue Mar 16, 2015
Upgrade recast dependency to v0.5.16 to fix #103
ramasilveyra pushed a commit to ramasilveyra/babel that referenced this issue Sep 30, 2017
existentialism pushed a commit that referenced this issue Oct 5, 2017
JacopKane pushed a commit to JacopKane/babel that referenced this issue Jan 11, 2018
@ghost ghost mentioned this issue Apr 13, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

4 participants