question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: source.visitorKeys[node.type] is not iterable

See original GitHub issue

eslint-plugin-unicorn@25.0.0

prefer-default-parameters.js:36:38

by code:

const length = quantity || 0;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
medusalixcommented, Jan 12, 2021

@yoyo837 Thanks. I did some debugging and noticed that this issue was actually caused by the following line:

const { genMode, quantity, seatUnit, rowsName, seatName, startFrom, ...restData } = formData;

It seems like ESLint considers the ...restData to be an ExperimentalRestProperty, which doesn’t have a corresponding entry in the visitorKeys map. I’ve fixed the issue by checking for undefined keys before iterating over them.

1reaction
yoyo837commented, Jan 12, 2021

mini code demo: ydmap-web-cloud.zip

unzip and run:

  • yarn install
  • yarn run lint

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do i get the TypeError "argument of type 'type' is not ...
But I seem not to be able to do the test, every time I get the TypeError "argument of type 'type' not iterable...
Read more >
How to Fix TypeError in Python: NoneType Object Is Not Iterable
The Python TypeError: NoneType Object Is Not Iterable is an exception that occurs when trying to iterate over a None value.
Read more >
Int Object is Not Iterable – Python Error [Solved]
If you are running your Python code and you see the error “TypeError: 'int' object is not iterable”, it means you are trying...
Read more >
TypeError: 'type' object is not iterable · Issue #1674 - GitHub
When trying to build documentation (any type: html, man pages, latexpdf...) sphinx fails while trying to autodoc a subdirectory of a project ...
Read more >
TypeError: argument of type 'NoneType' is not iterable error ...
TypeError : argument of type 'NoneType' is not iterable error during overcloud deployment. Solution Verified - Updated May 7 2020 at 6:55 AM ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found