Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "new keyword cannot be used with an optional chain" occurs when the constructor of a new expression is an optional chain, or if there's an optional chain between the constructor and the parenthesized list of arguments.

Reference entryJavaScriptFetched
SyntaxError: Invalid optional chain from new expression (V8-based)
As listed by MDN Web Docs
SyntaxError: new keyword cannot be used with an optional chain (Firefox)
As listed by MDN Web Docs
SyntaxError: Cannot call constructor 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.