Error when I am trying to debug a jQuery script locally
I am trying to debug a script using WebStorm 8.0 debug feature but the IDE does not seem to connect to the browser.
The browser (chrome) error I am getting in the browser javascript console is the following :
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/JqueryProject2/js/jquery-1.11.1.min.js.map
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/JqueryProject2/js/jq-ajax.js.map
Why does this page tries to access these map files?
Here is the source code of the script :
$('nav a').on('click', function(e) {
e.preventDefault();
var url = this.href; //URL to load
var $content = $('#content'); //Cache selection
$('nav a.current').removeClass('current'); //Update links
$(this).addClass('current');
$('#container').remove(); //Remove content
$.ajax({
type: "POST", //GET or POST
url: url, //Path to file
timeout: 20000, //Waiting time
beforeSend: function() {
$content.append('<div id="load">Loading</div>'); //Load message
},
complete: function() { //Once finished
$('#loading').remove(); //Clear message
},
success: function(data) { //Show content
$content.html($(data).find('#container')).hide().fadeIn(400);
},
fail: function() { //Show error msg
$('#panel').html('<div >Pleae try again soon.</div>');
}
});
});
Please sign in to leave a comment.
Do you have Chrome Dev tools open? The debugger is disconnected as soon as dev tools are opened - known Chrome issue, see http://code.google.com/p/chromium/issues/detail?id=129539
As for 404 errors, these messages are just the debug output: the Jetbrains IDE Chrome extension checks for presence of js.map files, and, if not found, prints a message. The reason for this checking is that some tools used to compress/transpile code don't generate required //sourceMapUrl comment the debugger needs to locate sourcemaps, so it checks some default locations for maps presence. So, these messages don't indicate any errors and don't do any harm, they can be safely ignored. This debug output will be filtered out in next WS version - see https://youtrack.jetbrains.com/issue/WEB-11049