An error report that says app.min.js:1:18422 is not a bug report, and the usual workaround — shipping the unminified bundle so it can be reproduced — changes the code you are trying to debug. A source map is a separate file describing the transformation, so the browser can map that column back to a file and a line you actually wrote.
// Gruntfile: uglify and less will both emit one
uglify: {
dist: {
options: { sourceMap: true, sourceMapName: 'dist/app.min.js.map' },
files: { 'dist/app.min.js': ['src/**/*.js'] }
}
},
less: {
dist: {
options: { sourceMap: true, sourceMapURL: '/dist/app.css.map' },
files: { 'dist/app.css': 'src/less/app.less' }
}
}
// appended to the built file, and this is the current spelling:
//# sourceMappingURL=app.min.js.map
The //@ spelling is the old one — it was deprecated because the @ form collided with IE’s conditional compilation — so a build tool from 2012 may still be emitting it, and the symptom is a map that exists on the server and is never fetched. The map is requested only when developer tools are open, so it costs users nothing, but it does mean the file is public: it carries a sourcesContent array with your original source inside it unless that is turned off and the sources uploaded separately. Restricting *.map to an internal network is the usual compromise. Do the CSS side at the same time — without one, a Less build attributes every rule to app.css line 4,000, which makes the inspector useless for exactly the stylesheet you edit most.