mapActions patch error Invalid attempt to destructure non-iterable instance
See original GitHub issueIf patch method is used via mapActions then get the below error. But, patch works if called directly via client.service(‘buy’).patch(this.thisOrder.id, this.thisOrder, {})
Error in client
nonIterableRest.js?061d:2 Uncaught TypeError: Invalid attempt to destructure non-iterable instance
at _nonIterableRest (nonIterableRest.js?061d:2)
at _slicedToArray (slicedToArray.js?f3e3:8)
at Store.patch (service-module.actions.js?6ac1:155)
at Array.wrappedActionHandler (vuex.esm.js?2f62:732)
at Store.dispatch (vuex.esm.js?2f62:437)
at Store.boundDispatch [as dispatch] (vuex.esm.js?2f62:331)
at Store.local.dispatch (vuex.esm.js?2f62:662)
at VueComponent.mappedAction (vuex.esm.js?2f62:935)
mapActions
...mapActions("buy", {
verifyPayment: "patch"
}),
Patch call
return this.verifyPayment(this.thisOrder.id, this.thisOrder, {})
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
TypeError: Invalid attempt to destructure non-iterable instance ...
So when you try to do that, it gives the error destructure non-iterable instance. Update the code like this: set_poject({commit}, paylod) { ...
Read more >How I Fixed: TypeError: Invalid attempt to destructure non ...
This morning I hit upon a really annoying problem whilst trying to write a basic test for a React component.
Read more >Invalid attempt to destructure non-iterable instance - Vue Forum
The player requires svg icons that are in the assets folder but I am getting error while running it. const requireAssets = require.context('../ ......
Read more >GOLEM Tokamak Wiki - Noc vědců_files/base.js
toString.call(t)) return Array.from(t); }(t) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance"); }(); } function S(t) ...
Read more >创建项目 (00e342e3) · Commits · 姚德海 / wsw-uni-app · GitLab
_children},p.prototype.update=function(t){this. ... o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.
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
@apmcodes @aessig That’s correct, you need to pass id, data and params in an array as vuex actions only takes one param.
https://github.com/feathersjs-ecosystem/feathers-vuex/blob/250901daf99ce0512a2046dd94a6ccaea2a5164e/src/service-module/service-module.actions.ts#L148
So you must call it like that:
@aessig try passing id and data as an array to mapped action such as patch. Like verifyPayment([id, data, params])