TypeScript-DOM-lib-generator
                                
                                 TypeScript-DOM-lib-generator copied to clipboard
                                
                                    TypeScript-DOM-lib-generator copied to clipboard
                            
                            
                            
                        `DOMStringList` missing iterator method
TypeScript blocks using [...location.ancestorOrigins] with the error
Type 'DOMStringList' must have a '[Symbol.iterator]()' method that returns an iterator. ts(2488)
However, it is present in Chrome:

It exists:
https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/2173711b06b303e39ba0c1c4a3c6921ba48f7616/baselines/dom.iterable.generated.d.ts#L37-L39
What does your tsconfig look like?
here's the tsconfig: https://github.com/widgetbot-io/embed/blob/master/tsconfig.json
here are the DOMStringList definitions VSCode found:
 

It's using VSCode's TS version (4.5.2) but I get the same error if I switch to the workspace version (4.2.2)
Ah sure, you also need to include "dom.iterable" next to "dom".
@orta could this kind of thing be autosuggested? 🤔
We've got a big chunk of checks in getCannotFindNameDiagnosticForName inside the compiler, (no point offering a link to the checker) but this can probably be added to that list. You have to manually set up your lib settings like this to trigger this case  as the iteration version would be added by default if you include es2015/es6+ in your target
Ah sure, you also need to include "dom.iterable" next to "dom".
Thanks, that worked! Is there a reason it isn't included in dom?
We've got a big chunk of checks in
getCannotFindNameDiagnosticForNameinside the compiler, (no point offering a link to the checker) but this can probably be added to that list.
There is no applicable identifier here (it's ...), so I guess there should be some tweak.
Thanks, that worked! Is there a reason it isn't included in dom?
target: es5 does not support iterators, so including it by default would be confusing. But not including it is also confusing in 2021. 🤔
This is solved, right?
@github-actions close
Closing because @saschanaz is one of the code-owners of this repository.