file is being assigned a //# sourceMappingURL but already has one - javascript

I just notice Firefox console outputs the following error for every single .js/.coffee file in my project (even the packages).
-file- is being assigned a //# sourceMappingURL, but already has one
Chrome's console doesn't show anything. I tried deleting all the .map files and clearing Firefox's cache but I'm still getting the errors.

It's a warning (not an error)
and it is a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1020846 fixed in FF 33)
This warning/error also applies to other libs (angular, backbone, etc.)

I have been working on a project for over a year now, I have never seen this message until roughly the last Firefox update.
I received it using jQuery 1.9.x, so I just updated my jQuery to 1.11.x and the error went away. I am now happy.
So, if you are using jQuery and see this Error/Warning, try updating your jQuery to the latest version.
Hope this helps someone.

In Firefox 27.0.1 I was getting this exact same error. I already have jQuery 1.11.0.
SyntaxError: Using //# to indicate sourceMappingURL pragmas is deprecated.
Use //# instead kendo.dataviz.min.js:25
22:09:26.635 Error: http://localhost/project/Scripts/kendo.dataviz.min.js is being assigned a //# sourceMappingURL, but already has one
I opened the kendo.dataviz.min.js and deleted the offending line:
//# sourceMappingURL=kendo.dataviz.min.js.map

put your code inside
$( document ).ready(function() {
//whatever
});
then the message dissappears.

For the people using Visual Studio 2013, and have downloaded the jQuery libraries via NuGet, check your jquery-x.x.x.min.js and you'll find the text comment below that's popping this warning on Firefox.
// # sourceMappingURL=jquery-x.x.x.min.map
You can safely remove those lines.

Update jquery - from the jQuery website http://www.jquery.com/download
You can also download a sourcemap file for use when debugging with a compressed file. The map file is not required for users to run jQuery, it just improves the developer's debugger experience. As of jQuery 1.11.0/2.1.0 the //# sourceMappingURL comment is not included in the compressed file.

Related

Disable deprecation in javascript console

I'm using a library from another person but it's probably pretty old and, even though it works just fine, I get a DEP066 deprecation error in my console when I run it.
I'm a COMPLETE noob when talking about javascript so I need your help. Is there a way to disable the deprecation warning/fix it if I use a newer function ?
EDIT:
Thank you so much! It works with the --no-deprecation option.
Try running the the script using the the --no-deprecation parameter which will "silence deprecation warnings":
node --no-deprecation script
Alternatively, --no-warnings will "silence all process warnings (including deprecations)."

Buddypress jq.cookie not a function

Having some issues with Buddypress, I have installed nearly every version since 2.7 and I still get the same issue with
Uncaught TypeError: jq.cookie is not a function
I found in the folder
plugins/buddypress/bp-themes/bp-default/_inc
there is a js file called
global.js
first line in this file is
var jq = jQuery;
I realise this is not correct as my jQuery uses $ not jQuery
I tried changing this, however.
console log still shows that its not a found function.
I'm using $. cookies in other javascript. So jQuery cookies are installed.
Also, no matter what i change in this global.js
it still results in the same output as a
# VM31193:1784
in chrome inspector as the original file.
Can anyone help me with this?

CKEditor throws error after adding Notification Plugin

I am attempting to add the notification plugin to CKEditor and I receive the following error when I go on any page implementing the CKEditor regardless if it attempts to use the Notification Plugin or not
Uncaught TypeError: CKEDITOR.tools.eventsBuffer is not a function
at Area (plugin.js?t=D2LI:448)
at Object.init (plugin.js?t=D2LI:17)
at Object.<anonymous> (ckeditor.js:221)
at n (ckeditor.js:202)
at Array.m (ckeditor.js:202)
at o (ckeditor.js:202)
at ckeditor.js:203
I am clearly including the plugin since I am getting these errors.
this is the line of code in the plugin that is causing the error.
this._uiBuffer = CKEDITOR.tools.eventsBuffer( 10, this._layout, this );
Any help is appreciated.
Please see: https://docs.ckeditor.com/#!/api/CKEDITOR.tools-method-eventsBuffer.
The error means that tools object doesn't have eventsBuffer method. There are two explanations which come to my mind:
This method is available since CKEditor 4.2.1. Please check your ckeditor/CHANGES.md file (your version is at the top) to find out which editor version you use. If your editor is anything below 4.2.1, please upgrade it to latest version. Please also note that if you want to use notifications you need to use at least CKEditor 4.5 - https://docs.ckeditor.com/#!/api/CKEDITOR.plugins.notification so upgrading to 4.2.1 won't help in this case.
This is a long shot but another possibility is that you have a third-party script which conflicts with CKEditor thus you get such result. If your editor is up to date, please try disabling other scripts, clearing browser's cache according to this link and checking the result one more time.
NOTE: To find out your version you can also click question mark icon on the toolbar (it is available if you have About plugin installed).

rails3-jquery-autocomplete: Javascript TypeError

Rails 3.2.11
I followed the instructions for this gem: https://github.com/crowdint/rails3-jquery-autocomplete. When I load the page that I want to have the autocompleted field, Jquery, jquery-ui, autocomplete-rails.js, etc are all being loaded. However, upon loading the page, I get this in the error console:
TypeError: 'undefined' is not a function (evaluating 'this.live')
The I uncompress the js file, and this is the function being referred to:
(function(jQuery)
{
var self = null;
jQuery.fn.railsAutocomplete = function() {
return this.live('focus',function() {
if (!this.railsAutoCompleter) {
this.railsAutoCompleter = new jQuery.railsAutocomplete(this);
}
});
};
Anyone have any idea what's going on? Since I'm not using '$' anywhere, the noConflict option doesn't seem to matter, and either way doesn't fix the issue. I didn't make any changes to autocomplete-rails.js
What's weird is that I swear this was working at some point, but I can't for the life of me figure out what changed to break it.
Yup, turns out I had an errant javascript_include_tag that loaded another copy of jquery. That was the issue
I believe the original poster's own answer was part of the solution for me as well. Using rails 3.2.13, jquery 1.9.0 and jquery-ui 1.9.2. More completely I also:
upgraded rails3-jquery-autocomplete to latest (from 1.0.9 to 1.0.11, when I saw: "When possible, use jQuery .on() rather than .live()" in the Changelog in rails3-jquery-autocomplete at github
removed possibly redundant or conflicting jquery includes
reordered includes, specifically placing underscore.js after autocomplete-rails
full stop and clearing of caches and compiled assets
After the first 3 steps, the broken behavior was still there (after each step I restarted server only). The last step was out of laziness, but thankfully showed that the combination of the above worked.

How to solve error: "undefined is null or not object ie in ext js" in IE?

I think its the cause of trailing comma, or syntax error, variable used without declaration. My js fiel is 1000 lines od code. Since the error is not provding me the line no. Its becoming dfficult to debug. Please help me with debugging techniques for IE. The script works very well with Firefox, Safari.
I'd jslint the file. That will find the issue as well as any others you may have.
You can run it as a command line utility via node.
include this <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> and <html debug="true"> will give you an firebug console
http://getfirebug.com/firebuglite#Debug
For debugging in IE I would recommend you install DebugBar. This extension is similar to FireBug for Firefox.
If you are developing through Microsoft Visual Studio I remember it will help you find trailing commas by highlighting the following } element with a green curly underline.
If you use the built-in developer tools in IE8 and later, you can step through your code in the browser and determine which line causes the error - starting from the top.
If you are not using any debugging tools in IE, then I will advise you to - just like Johan and bjornd are suggesting.
Happy hunting :)
If you are using eclipse :
configure spket plug-in editor for java script
It will highlight the missing/incomplete syntax (e.g comma/semicolon)
so you don't need to debug for syntax errors
Guys, I finally did it ? I took the strength of all your techniques.
1) I put the code in a single
try{
code
}
and catch(e) {
alert('Final Err: '+ e.description);
}
and kept initial 200 lines uncommented and the rest commented and ran the file
while(EOF) {
if(got an alert of error)
checked for trailing commas & putting missed semicolons till end.
else
adding some more lines later uncommented out of the commented and ran the file.
}
Finally, the page got succesfully loaded !!!
I had this issue using the Extjs RowExpander user extension. The issue only occurred in IE. I was able to fix it by adding a few lines of code at the top of the 'toggleRow' method:
if (!this.view) {
this.bindView();
}
For some reason IE occasionally chokes on references to 'this.view' (likely a timing issue). Running 'bindview()' ensures that 'this.view' resolves appropriately.

Categories

Resources