Template literals are strings enclosed with backticks (``). These may contain placeholder expressions with the syntax ${..}, which are evaluated at runtime and inserted as part of the string.

Ordinary string literals may be enclosed by single ('') or double quotes (""), and the placeholder syntax ${..} has no special meaning in these.

In files that make use of template literals, it is hard to distinguish actual template literals from ordinary strings that happen to contain placeholder syntax. This is often the result of mistyping the quotes on a template literal.

Consider if this was intended to be a template literal, and if so, change the quotes to backticks (``). Alternatively:

In the following example, the call to log.error will log the string "${id}", rather than the contents of the id variable.

To correct the error message, change the quotes to backticks:

  • Mozilla Developer Network: Template literals.