Open In App

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

Last Updated : 24 Aug, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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




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


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




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


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


Previous Article
Next Article

Similar Reads

JavaScript SyntaxError - Applying the 'delete' operator to an unqualified name is deprecated
This JavaScript exception applying the 'delete' operator to an unqualified name is deprecated works in strict mode and it occurs if variables are tried to be deleted with the delete operator. Message: SyntaxError: Calling delete on expression not allowed in strict mode (Edge) SyntaxError: applying the 'delete' operator to an unqualified name is dep
1 min read
JavaScript SyntaxError - "0"-prefixed octal literals and octal escape sequences are deprecated
This JavaScript exception 0-prefixed octal literals and octal escape sequences are deprecated works in strict mode only. For octal literals, the "0o" prefix can be used instead. Message: SyntaxError: Octal numeric literals and escape characters not allowed in strict mode (Edge) SyntaxError: "0"-prefixed octal literals and octal escape sequences are
1 min read
How to indicate text is important in HTML ?
In this article, we will know how to indicates the important text or mark texts as important in HTML. There are several HTML elements that are used for defining text with a special meaning. There are several formatting elements in HTML, some of them are &lt;strong&gt;, &lt;b&gt;, &lt;i&gt;, &lt;em&gt;, &lt;mark&gt;, &lt;small&gt;, &lt;sup&gt;, &lt;
2 min read
How to indicate character set being used by a document in HTML ?
For web browser to understand the set of characters used in the HTML document, various HTML encoding character set representations has been used like ASCII, ISO-8859-1, UTF-8 etc. The character set being used by an HTML document is indicated using the charset attribute of a &lt;meta&gt; tag inside the &lt;head&gt; element of the HTML. In HTML4, ISO
2 min read
JavaScript SyntaxError - "use strict" not allowed in function with non-simple parameters
This JavaScript exception 'use strict' not allowed in function occurs if strict modes 'use strict' statement is used at the beginning of a function with default parameters, rest parameters, or destructuring parameters. Message: Edge: Cannot apply strict mode on functions with non-simple parameter list Firefox: SyntaxError: "use strict" not allowed
1 min read
JavaScript ReferenceError Deprecated caller or arguments usage
This JavaScript exception deprecated caller or arguments usage occurs only in strict mode. It occurs if any of the Function.caller or Function.arguments properties are used, Which are depreciated. Message: TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (Edge) Warning: Referenc
1 min read
JavaScript Warning - Date.prototype.toLocaleFormat is deprecated
This JavaScript warning Date.prototype.toLocaleFormat is deprecated; consider using Intl.DateTimeFormat instead occurs if user is using the non-standard Date.prototype.toLocaleFormat method. Message: Warning: Date.prototype.toLocaleFormat is deprecated; consider using Intl.DateTimeFormat instead Error Type: Warning. JavaScript execution won't be ha
1 min read
When we use Escape Instead of encodeURI / encodeURIComponent in JavaScript ?
A URL consists of many characters, both special and unique. Unique characters include those that are not plain standard such as spaces etc. So it means that we need to encode characters in UTF-8. So if we have a string such as: "https://www.gfg.com/what is html?" then UTF-8 will encode it as "https://www.gfg.com/what%20is%20html". encodeURI() and e
3 min read
JavaScript SyntaxError "variable" is a reserved identifier
This JavaScript exception variable is a reserved identifier occurs if the reserved keywords are used as identifiers. Message: SyntaxError: The use of a future reserved word for an identifier is invalid (Edge) SyntaxError: "x" is a reserved identifier (Firefox) SyntaxError: Unexpected reserved word (Chrome) Error Type: SyntaxError What happened? Whe
1 min read
JavaScript SyntaxError: Unterminated string literal
This JavaScript error unterminated string literal occurs if there is a string that is not terminated properly. String literals must be enclosed by single (') or double (") quotes. Message: SyntaxError: Unterminated string constant (Edge) SyntaxError: unterminated string literal (Firefox) Error Type: SyntaxError What happened? There is a string in t
1 min read