Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "tagged template cannot be used with optional chain" occurs when the tag expression of a tagged template literal is an optional chain, or if there's an optional chain between the tag and the template.

Reference entryJavaScriptFetched
SyntaxError: Invalid tagged template on optional chain (V8-based)
As listed by MDN Web Docs
SyntaxError: tagged template cannot be used with optional chain (Firefox)
As listed by MDN Web Docs
SyntaxError: Cannot use tagged templates in an optional chain. (Safari)
As listed by MDN Web Docs
Category
SyntaxError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.273Z.