ember-power-select
ember-power-select copied to clipboard
Action passed is null or undefined / else-block not working at ember-v3.8.1
I'm updating our app from ember-2.18 to ember-3.8.1 (using ember-power-select v2.2.3)
This code has worked earlier:
{{#power-select-multiple options=(sort-alphabetically tags "text") selected=model.tags searchField="text" onkeydown=(action "onkeydown") closeOnSelect=false onchange=(action (mut model.tags)) as |t| }}
{{t.text}}
{{else}}
<div class="text-center">
<button class="button secondary small" {{action "createTag"}}>{{t "createtag" tag=searchText}}</button>
</div>
{{/power-select-multiple}}
Now following error occurs:
Uncaught Error: Assertion Failed: Action passed is null or undefined in (action) from <myapp@component:power-select-multiple::ember615>.
At first I was thinking that the action "createTag" was causing the error but it wasn't. The error occurs when using
{{#power-select-multiple [...] as |t| }}
{{t.text}}
{{else}}
n/a
{{/power-select-multiple}}
as well.
After removing the {{else}} block - it's working again.
{{#power-select-multiple [...] as |t| }}
{{t.text}}
{{/power-select-multiple}}
The error message was not clear and I tried several approaches to get what's wrong.
I'm able to ship around using noMatchesMessage=...
but as you can see, we're using custom html with actions in this section.
Maybe someone can take a look what's happening...
Running into this on Ember 3.4.6 (prepping to upgrade to 3.8). Happens in a custom component that extends power-select and uses several custom sub-components.
The issue started showing up for me as I was removing all of our ember-decorator
usage in preparation for the upgrade to 3.8 and native decorators. I don't use the {{else}}
in the yielded option block as the OP does. I do have some custom logic in the main template to render an async vs. static power-select based on if the search
parameter is provided.
"Error: Assertion Failed: Action passed is null or undefined in (action) from <fulcrum-ui@component:slds-lookup::ember367>.
at new EmberError (http://localhost:4200/assets/vendor.js:21210:31)
at assert (http://localhost:4200/assets/vendor.js:20074:23)
at makeClosureAction (http://localhost:4200/assets/vendor.js:43147:82)
at makeDynamicClosureAction (http://localhost:4200/assets/vendor.js:43138:13)
at action (http://localhost:4200/assets/vendor.js:43100:18)
at Object.evaluate (http://localhost:4200/assets/vendor.js:29336:21)
at AppendOpcodes.evaluate (http://localhost:4200/assets/vendor.js:29165:27)
at LowLevelVM.evaluateSyscall (http://localhost:4200/assets/vendor.js:32014:28)
at LowLevelVM.evaluateInner (http://localhost:4200/assets/vendor.js:31986:22)
at LowLevelVM.evaluateOuter (http://localhost:4200/assets/vendor.js:31978:22)"
scratch that my issue turned out to be some weird inconsistencies with Class vs. classic components and template invocations.
I admit I didn't eve see this issue until now because I was attending my child birth precisely that day. @dogindot Is this still an issue. I believe I can investigate it this week if it's still a problem, however since in 3.0 there is no inverse block at all (because angle-bracket syntax does not support it yet) it may not be worth it.
any updates here? I got the same issue on Ember 3.0.0 after the upgrade ember-power-select-typeahead
from 0.6.1
to 0.7.4
.
Is it possible to use some workaround to keep "else" logic-branch?