Open patocallaghan opened 4 years ago
I'm also encountering this issue with a variable called task being interpreted as a call to the task helper in ember-concurrency
@jakesjews thanks for that. I actually found some instances not covered by our tests blowing up because of variables called task
. I've updated the title to reflect that.
Reopening as I closed this by mistake 🤦♂️
I've just updated the test reproduction repo with a failing test for the task
scenario. The error stack trace it fires is:
Uncaught (in promise) TypeError: Cannot read property '_curry' of undefined
at taskHelper (vendor.js:93445)
at vendor.js:5827
at deprecateMutationsInAutotrackingTransaction (vendor.js:55292)
at EmberHelperRootReference.fnWrapper [as fn] (vendor.js:5826)
at vendor.js:47166
at runInAutotrackingTransaction (vendor.js:55264)
at track (vendor.js:55774)
at EmberHelperRootReference.compute (vendor.js:47165)
at new HelperRootReference (vendor.js:47139)
at new EmberHelperRootReference (vendor.js:5844)
So this issue started happening from 3.17.0-beta.1 (from the glimmer-vm upgrade) and is still happening in 3.17.0-beta.6. It works in 3.16.3 fine.
Say I have a component which takes a property called
@action
, e.g.where
this.action
is something like{ foo: 'bar' }
. Then in the component if you try to assign the{{action.foo}}
value to any attribute or a component arg like so:You get the following error:
It seems the renderer chokes up because it thinks this is an invocation of the actual
{{action}}
helper or something like that. If you remove the ambiguity of the property by doing{{this.action.foo}}
or{{@action.foo}}
it works as expected.I debated whether to open this as it was a trivial thing to fix in my app but thought I'd raise it anyway. You may decide it's not worth fixing.
I have a reproduction of the bug in this repo here https://github.com/patocallaghan/name-action-bug (Run
yarn test -s -f="failing"
to get failing tests and see the test file in https://github.com/patocallaghan/name-action-bug/blob/master/tests/integration/components/failing-test.js)Update: see comment below but this also applies to variables named
{{task
as well and you have ember-concurrency installed.