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 maps broken in 10.2.0 #1264

Closed
playpauseandstop opened this issue May 14, 2015 · 6 comments
Closed

Source maps broken in 10.2.0 #1264

playpauseandstop opened this issue May 14, 2015 · 6 comments

Comments

@playpauseandstop
Copy link

Looks like update browser-pack to ^5.0.0 broke source maps management by exorcist.

file.js:

console.log("It works!");
$ npm list browserify exorcist
├── browserify@10.1.3 
├── exorcist@0.3.0
$ `npm bin`/browserify --debug file.js | `npm bin`/exorcist bundle.js > bundle.map
$ echo $?
0

But after upgrade browserify to 10.2.0 exorcist doesn't understand source map generated by browserify,

$ `npm bin`/browserify --debug file.js | `npm bin`/exorcist bundle.js > bundle.map
The code that you piped into exorcist contains no source map!
Therefore it was piped through as is and no external map file generated.

Source file bundled as,

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
console.log("It works!");

},{}]},{},[1])
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJmaWxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FDQUE7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiKGZ1bmN0aW9uIGUodCxuLHIpe2Z1bmN0aW9uIHMobyx1KXtpZighbltvXSl7aWYoIXRbb10pe3ZhciBhPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7aWYoIXUmJmEpcmV0dXJuIGEobywhMCk7aWYoaSlyZXR1cm4gaShvLCEwKTt2YXIgZj1uZXcgRXJyb3IoXCJDYW5ub3QgZmluZCBtb2R1bGUgJ1wiK28rXCInXCIpO3Rocm93IGYuY29kZT1cIk1PRFVMRV9OT1RfRk9VTkRcIixmfXZhciBsPW5bb109e2V4cG9ydHM6e319O3Rbb11bMF0uY2FsbChsLmV4cG9ydHMsZnVuY3Rpb24oZSl7dmFyIG49dFtvXVsxXVtlXTtyZXR1cm4gcyhuP246ZSl9LGwsbC5leHBvcnRzLGUsdCxuLHIpfXJldHVybiBuW29dLmV4cG9ydHN9dmFyIGk9dHlwZW9mIHJlcXVpcmU9PVwiZnVuY3Rpb25cIiYmcmVxdWlyZTtmb3IodmFyIG89MDtvPHIubGVuZ3RoO28rKylzKHJbb10pO3JldHVybiBzfSkiLCJjb25zb2xlLmxvZyhcIkl0IHdvcmtzIVwiKTtcbiJdfQ==

So //# sourceMappingURL... contains in bundle, but couldn't be recognized by exorcist.

@zertosh
Copy link
Member

zertosh commented May 14, 2015

Seems like it's a problem with exorcist's mold-source-map using an older convert-source-map. I think it's not recognizing charset - like this.

Can you try updating their convert-source-map to see if it fixes it?

@zertosh
Copy link
Member

zertosh commented May 14, 2015

Ah yeah, looking at the regex, that would make sense.

@playpauseandstop
Copy link
Author

@zertosh thanks for clarification.

Opened issue in convert-source-map repo, but I'm not sure that this issue could be closed now as exorcist is "official" way for managing source maps with browserify and it broken with latest browserify release.

@zertosh
Copy link
Member

zertosh commented May 14, 2015

@playpauseandstop I opened thlorenz/mold-source-map#6 in mold-source-map to fix the problem. When/if that gets merged and published, depending on the version, it might then require yet another PR in exorcist.

@thlorenz
Copy link
Collaborator

I merged the commit and updated exorcist as well.

@playpauseandstop
Copy link
Author

Thanks, guys! Confirmed that now everything works as expected.

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

No branches or pull requests

3 participants