Class private methods are not enabled.
See original GitHub issueI just upgraded tracked-built-ins in an addon and am getting this error:
Build Error (broccoli-persistent-filter:Babel > [Babel: tracked-built-ins]) in tracked-built-ins/-private/object.js
ember-statechart-component/tracked-built-ins/-private/object.js: Class private methods are not enabled.
65 |
66 | // @private
> 67 | #readStorageFor(key) {
| ^
68 | let storage = this.#storages.get(key);
69 |
70 | if (storage === undefined) {
but, whatβs weird, is that Iβve worked on tracked-built-ins with private methodsβ¦ and this wasnβt an issue at all.
My ember-cli-babel appears up to date:
β― npm ls ember-cli-babel
βββ¬ @ember/test-helpers@2.6.0
β βββ¬ @ember/test-waiters@3.0.0
β β βββ ember-cli-babel@7.26.6 deduped
β βββ ember-cli-babel@7.26.6 deduped
β βββ¬ ember-destroyable-polyfill@2.0.3
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ @glimmer/component@1.0.4
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-auto-import@1.12.0
β βββ¬ @embroider/core@0.33.0
β β βββ¬ @embroider/macros@0.33.0
β β βββ ember-cli-babel@7.26.6 deduped
β βββ ember-cli-babel@7.26.6 deduped
βββ ember-cli-babel@7.26.6
βββ¬ ember-cli-typescript-blueprints@3.0.0
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-could-get-used-to-this@1.0.1
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-load-initializers@2.1.2
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-maybe-import-regenerator@0.1.6
β βββ ember-cli-babel@6.18.0
βββ¬ ember-page-title@6.2.2
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-qunit@5.1.5
β βββ ember-cli-babel@7.26.6 deduped
β βββ¬ ember-cli-test-loader@3.0.0
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-resolver@8.0.3
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ ember-source@3.26.2
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ qunit-dom@1.6.0
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ tracked-built-ins@2.0.0
β βββ ember-cli-babel@7.26.6 deduped
β βββ¬ ember-tracked-storage-polyfill@1.0.0
β βββ ember-cli-babel@7.26.6 deduped
βββ¬ tracked-maps-and-sets@3.0.2
βββ ember-cli-babel@7.26.6 deduped
ember-statechart-component on ξ upgrade-debs [$!]
origin git@github.com:NullVoxPopuli/ember-statechart-component.git
β― latestPkgVer ember-cli-babel
Current:
"7.26.6"
Tags:
{
"latest": "7.26.6",
"alpha": "7.0.0-alpha.2",
"beta": "7.24.0-beta.2",
"5.x": "5.2.8",
"old": "6.17.2"
}
Most Recent:
"7.26.6"
and browserslist seems to be up to date as well.
β― npx browserslist --update-db
Latest version: 1.0.30001279
Installed version: 1.0.30001279
caniuse-lite is up to date
caniuse-lite has been successfully updated
No target browser changes
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:47 (37 by maintainers)
Top Results From Across the Web
How to Enable Private Method Syntax Proposal in React App?
I got "Class private methods are not enabled." error when running npm start on a project using leading # to indicate private methods....
Read more >babel/plugin-proposal-private-methods
When true, private methods will be assigned directly on its parent via Object.defineProperty rather than a WeakSet . This results in improved performanceΒ ......
Read more >Babel 7.14 enables class fields & private methods by default ...
Babel 7.14 enables class fields & private methods by default in @babel/preset-env ... Babel is a free and open-source JavaScript transcompiler. ItΒ ...
Read more >Private class features - JavaScript - MDN Web Docs - Mozilla
Class fields are public by default, but private class members can be ... Unlike public methods, private methods are not accessible onΒ ...
Read more >@babel/plugin-proposal-private-methods - npm
This plugin transforms private class methods. Latest version: 7.18.6, last published: 6 months ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
rwjblue and I are going to try to get this knocked out tomorrow; in the meantime, folks may be able to work around it by pinning
caniuse-lite
to1.0.30001280
. (We did that for an internal addon and it did the trick.)All right, cool. Iβll chat with @rwjblue and see if we can land the fix in ember-cli-babel now that Data is unblocked, and that should then cascade out to the rest of the ecosystem βautomagicallyβ by way of Renovate/Dependabot/etc.