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

JavascriptFirefoxMeteorSource Maps

Javascript Problem Overview


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.

Javascript Solutions


Solution 1 - Javascript

It's a warning (not an error) and it is a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1020846</s> fixed in FF 33)

This warning/error also applies to other libs (angular, backbone, etc.)

Solution 2 - Javascript

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.

Solution 3 - Javascript

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

Solution 4 - Javascript

put your code inside

   $( document ).ready(function() {
   //whatever
   });

then the message dissappears.

Solution 5 - Javascript

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.

Solution 6 - Javascript

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionManuelView Question on Stackoverflow
Solution 1 - JavascriptIchView Answer on Stackoverflow
Solution 2 - JavascriptDavid V.F. BurtonView Answer on Stackoverflow
Solution 3 - JavascriptLeniel MaccaferriView Answer on Stackoverflow
Solution 4 - JavascriptraschidView Answer on Stackoverflow
Solution 5 - Javascriptemerson.mariniView Answer on Stackoverflow
Solution 6 - JavascriptDamianView Answer on Stackoverflow