Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error when combining cached with private getter #93

Open
tehhowch opened this issue Jul 19, 2021 · 0 comments
Open

Build error when combining cached with private getter #93

tehhowch opened this issue Jul 19, 2021 · 0 comments

Comments

@tehhowch
Copy link

Ember v3.24
polyfill v0.1.3

If I create a component that has a private getter, attempting to use the cached decorator results in a build error:

import Component from '@glimmer/component';
import { cached } from 'ember-cached-decorator-polyfill';

export default Boom extends Component {
  @cached
  get #expensiveGetter() {
    // ...
  }
}

yields

Build Error (broccoli-persistent-filter:Babel > [Babel: my-addon-name]) in my-addon-name/components/boom.js

/Users/me/apps/monorepo/packages/my-app/my-addon-name/components/boom.js: Property value expected type of string but got null

Removing the # (i.e. not using a private getter) results in a working build, as expected.

(I ran into this with a component that was located in an in-repo addon, when building the consuming application, but I did verify that it also occurs if using @cached in the consuming app directly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant