Skip to content
JS
JavaScript error

TypeError

The JavaScript strict mode-only exception "setting getter-only property" occurs when there is an attempt to set a new value to a property for which only a getter is specified, or when setting a private accessor property that similarly only has a getter defined.

Reference entryJavaScriptFetched
TypeError: Cannot set property x of #<Object> which has only a getter (V8-based)
As listed by MDN Web Docs
TypeError: '#x' was defined without a setter (V8-based)
As listed by MDN Web Docs
TypeError: setting getter-only property "x" (Firefox)
As listed by MDN Web Docs
TypeError: Attempted to assign to readonly property. (Safari)
As listed by MDN Web Docs
TypeError: Trying to access an undefined private setter (Safari)
As listed by MDN Web Docs
Category
TypeError in strict mode only
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.