dukat
dukat copied to clipboard
Conversion fails for chrome type def file
Getting the following error when converting the chrome typescript definition file.
$ npm install -g dukat@next
$ wget https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chrome/index.d.ts
$ dukat index.d.ts
unresolved exception
TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at __values (/usr/local/lib/node_modules/dukat/lib/converter.js:363:71)
at AstConverter.convertVariableDeclarationList (/usr/local/lib/node_modules/dukat/lib/converter.js:1130:27)
at AstConverter.convertIterationStatement (/usr/local/lib/node_modules/dukat/lib/converter.js:1156:60)
at AstConverter.convertStatement (/usr/local/lib/node_modules/dukat/lib/converter.js:1205:43)
at AstConverter.<anonymous> (/usr/local/lib/node_modules/dukat/lib/converter.js:1266:89)
at step (/usr/local/lib/node_modules/dukat/lib/converter.js:357:23)
at Object.<anonymous> (/usr/local/lib/node_modules/dukat/lib/converter.js:338:53)
at step (/usr/local/lib/node_modules/dukat/lib/converter.js:342:139)
at Object.<anonymous> (/usr/local/lib/node_modules/dukat/lib/converter.js:338:53)
at Function.from (native)
Tried with the latest version. Now it shows a slightly different error message.
unresolved exception
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at __values (/usr/local/lib/node_modules/dukat/lib/converter.js:363:72)
at AstConverter.convertVariableDeclarationList (/usr/local/lib/node_modules/dukat/lib/converter.js:1130:27)
at AstConverter.convertIterationStatement (/usr/local/lib/node_modules/dukat/lib/converter.js:1156:60)
at AstConverter.convertStatement (/usr/local/lib/node_modules/dukat/lib/converter.js:1205:43)
at AstConverter.<anonymous> (/usr/local/lib/node_modules/dukat/lib/converter.js:1266:89)
at step (/usr/local/lib/node_modules/dukat/lib/converter.js:357:23)
at Object.next (/usr/local/lib/node_modules/dukat/lib/converter.js:338:53)
at step (/usr/local/lib/node_modules/dukat/lib/converter.js:342:139)
at Object.next (/usr/local/lib/node_modules/dukat/lib/converter.js:338:53)
at Function.from (<anonymous>)
You may need to append "?raw=True" to that wget command, otherwise you'll pull the HTML-ized version of the file.
I was getting a similar error until I deleted all the comments in that file preceding interface Window on line 27
@ptrckSTL wow..thanks very much, that worked! It's really weird that it worked after removing the valid comments 😄