TypeError: Invalid attempt to destructure non-iterable instance
See original GitHub issueHI… im new in this project…but when run the code like belove
export function showMessage() {
return {
type: SHOW_MESSAGE,
promise: (client) => client.get('/posts')
};
}
i get this error: TypeError: Invalid attempt to destructure non-iterable instance can anyone Helllllp Me??? tnx
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
React JS Error: Invalid attempt to destructure non-iterable ...
Invalid attempt to destructure non-iterable instance says the instance you are trying to iterate is not iterable.
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. #65 - GitHub
I am trying the picker on the expo app, I get this error. I tried the sample Single Date picker code. why is...
Read more >Invalid attempt to destructure non-iterable instance-Reactjs
Coding example for the question Uncaught TypeError: Invalid attempt to destructure non-iterable instance-Reactjs.
Read more >invalid attempt to destructure non-iterable instance
The error Invalid attempt to destructure non-iterable instance occurs because of a logic/coding error. The following javascript is used to illustrate the ...
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 Free
Top 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
Hi @majidkarimizadeh. I believe you should follow @jahmaiosullivan’s advice and make your type an Array. In your case try something like the following, instead of changing the middleware.
Try giving all your fetch actions the same types pattern.
It looks like babel is trying to destructure types in
const [REQUEST, SUCCESS, FAILURE] = types;
and is failing - check that yourtypes
in your action creators are defined & have >=3 elementsThis is a typo, it should be types: [REQUEST, SUCCESS,FAILURE]