[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/No_non-null_object [Back]  [Original]

TypeError: "x" is not a non-null object - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

TypeError: "x" is not a non-null object

JavaScript "is not a non-null object" null

js
TypeError: Invalid descriptor for property {x} (Edge)
TypeError: "x" is not a non-null object (Firefox)
TypeError: Property description must be an object: "x" (Chrome)
TypeError: Invalid value used in weak set (Chrome)

TypeError

null

Object.create() Object.defineProperty() Object.defineProperties() ()

js
Object.defineProperty({}, "key", 1);
// TypeError: 1 is not a non-null object

Object.defineProperty({}, "key", null);
// TypeError: null is not a non-null object

js
Object.defineProperty({}, "key", { value: "foo", writable: false });

WeakMap WeakSet

WeakMap WeakSet

js
var ws = new WeakSet();
ws.add("foo");
// TypeError: "foo" is not a non-null object

js
ws.add({ foo: "bar" });
ws.add(window);


Web Proxy Viewer  |  New URL  |  Original Page