JavaScript SyntaxError – Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead

This JavaScript warning Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead occurs if there is a source map syntax defined in a JavaScript source, Which has been depreciated. 

Message:

Warning: SyntaxError: Using //@ to indicate sourceURL pragmas 
                      is deprecated. Use //# instead
Warning: SyntaxError: Using //@ to indicate sourceMappingURL 
                      pragmas is deprecated. Use //# instead

Error Type:

This is a warning that a SyntaxError has occurred. 
JavaScript execution won't be halted.

Cause of Error: Somewhere in the code, there is a source map syntax used in a JavaScript source, Which is depreciated.

Example 1: In this example, the sourceURL is used with @, Which is depreciated.



HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    //@ sourceURL=http://abcd.com/path/name.map
</script>

chevron_right


Output:

Warning: SyntaxError: Using //@ to indicate sourceURL 
         pragmas is deprecated. Use //# instead

Example 2: In this example, the sourceMappingURL is used with @, Which is depreciated.

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    //@ sourceMappingURL=http://abcd.com/path/name.map
</script>

chevron_right


Output:

arning: SyntaxError: Using //@ to indicate sourceMappingURL
                     pragmas is deprecated. Use //# instead

Reference link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_source_map_pragma

full-stack-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.