Jamie Hutber
Jamie Hutber

Reputation: 28076

javaScript Source maps not working

I have been using sourcemaps generated via gulp to debug for a while without problems. I have recently updated my chrome and they stopped working.

So, I know they should be working and I also can see the source maps inside of the js file generated.

var bundler = browserify({
    // Required watchify args
    cache: {}, packageCache: {}, fullPaths: true,
    // Specify the entry point of your app
    entries: ['./js/init.js'],
    // Add file extentions to make optional in your requires
    extensions: ['.js'],
    // Enable source maps!
    debug: true
});

This is my bundler to generate my js file.

//#     
    sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlc1xcYnJvd3NlcmlmeVx
    ......
    HVybiBfO1xuICAgIH0pO1xuICB9XG59LmNhbGwodGhpcykpO1xuIl19

Point being, I know that the source maps are currently being built... But for some reason chrome cannot interact them.

I obviously want the sourcemaps to work. How can I get them working? Maybe a setting in chrome?

Upvotes: 2

Views: 909

Answers (1)

Jamie Hutber
Jamie Hutber

Reputation: 28076

Took me a while and I hate answering my own questions. But who knows somebody else might have the same problem...

My script include had async this little guy was the cause of all evil!!

Wrong

 <script src="/js/app.js" async></script>

Correct

 <script src="/js/app.js"></script>

Upvotes: 2

Related Questions