Get to know MDN better
The JavaScript exception "SyntaxError: private fields can't be deleted" occurs when delete is used on a private element of a class or an object.
There's code trying to delete a private element (field or method) of an object or a class. This is forbidden by JavaScript—private elements cannot be added or removed on the fly.
This page was last modified on Jul 8, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.