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

Import computed.bool from the right package #340

Closed
aoumiri opened this issue May 6, 2021 · 8 comments
Closed

Import computed.bool from the right package #340

aoumiri opened this issue May 6, 2021 · 8 comments

Comments

@aoumiri
Copy link

aoumiri commented May 6, 2021

With the latest release of ember 3.27.0, it's no longer possible to use computed.bool like that:

import { computed } from '@ember/object';

// ...
  someAttribute: computed.bool('someTrackedProperty'),
// ...

But instead we should do:

import { bool } from '@ember/object/computed';

// ...
  someAttribute: bool('someTrackedProperty'),
// ...

Otherwise, this is the error we get: Uncaught TypeError: Ember.computed.bool is not a function.

tzellman added a commit to tzellman/ember-stopwatch that referenced this issue May 10, 2021
- was failing the release channel build (adopted-ember-addons/ember-moment#340)
- only used in the dummy app
- replaced with a simple helper that uses moment directly (via auto-import)

fixes #112
tzellman added a commit to tzellman/ember-stopwatch that referenced this issue May 10, 2021
- was failing the release channel build (adopted-ember-addons/ember-moment#340)
- only used in the dummy app
- replaced with a simple helper that uses moment directly (via auto-import)

fixes #112
@schorke
Copy link

schorke commented Jul 9, 2021

@aoumiri I don't understand why this error exists (we encountered the same error) while Ember.computed.bool is only deprecated in Ember 3.27.0 and should stay deprecated until Ember 4.0.0 , so it should not cause an error...

Did I miss something or am I completely dumb ?

@timmyomahony
Copy link

timmyomahony commented Aug 19, 2021

I'm encountering this with ember-moment 8.0.1 on ember-source 3.28.0 running the following in a template:

{{moment-format (now) 'YYYY'}}

Throws the error:

Uncaught TypeError: Ember.computed.bool is not a function
    at Module.callback (-base.js:10)
    at Module.exports (loader.js:106)
    at Module._reify (loader.js:143)
    at Module.reify (loader.js:130)
    at Module.exports (loader.js:104)
    at Module._reify (loader.js:143)
    at Module.reify (loader.js:130)
    at Module.exports (loader.js:104)
    at requireModule (loader.js:27)
    at Class._extractDefaultExport (index.js:462)

Which seems to relate to here:

https://github.com/stefanpenner/ember-moment/blob/382ddd1238c7bcab2f66225830d18aca5364c2f6/addon/helpers/-base.js#L9

@timmyomahony
Copy link

Just to note, the PR from here fixes this for me:

#351

You can get it with:

yarn add stefanpenner/ember-moment#351/head

@aoumiri
Copy link
Author

aoumiri commented Aug 19, 2021

@jasonmit @stefanpenner can anyone of you have a look at this PR? Or any maintainer 🙏

Thanks 😊

@robclancy
Copy link

Isn't this an ember bug? I am getting these same errors from app code when it was just meant to be a deprecation.

@aoumiri
Copy link
Author

aoumiri commented Aug 28, 2021

Ember bug or not, I think it's still worth fixing now if it will be deprecated. Rather than waiting for the next major. WDYT ?

@esbanarango
Copy link

#351 (comment)

@NullVoxPopuli
Copy link
Collaborator

Fix released in 8.0.2

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

Successfully merging a pull request may close this issue.

6 participants