Skip to content
JS
JavaScript error

TypeError

The JavaScript exception "Initializing an object twice is an error with private fields/methods" occurs when an object that was created via a class constructor goes through the class construction again, and the class contains a private element. This is usually caused by the return override trick.

Reference entryJavaScriptFetched
TypeError: Cannot initialize #x twice on the same object (V8-based)
As listed by MDN Web Docs
TypeError: Initializing an object twice is an error with private fields (Firefox)
As listed by MDN Web Docs
TypeError: Cannot redefine existing private field (evaluating 'super(o)') (Safari)
As listed by MDN Web Docs
TypeError: Cannot initialize private methods of class X twice on the same object (V8-based)
As listed by MDN Web Docs
TypeError: Initializing an object twice is an error with private methods (Firefox)
As listed by MDN Web Docs
TypeError: Cannot install same private methods on object more than once (evaluating 'super(o)') (Safari)
As listed by MDN Web Docs
Category
TypeError
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.274Z.