dukat icon indicating copy to clipboard operation
dukat copied to clipboard

Conversion fails for chrome type def file

Open sureshg opened this issue 5 years ago • 3 comments

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)

sureshg avatar Dec 03 '20 04:12 sureshg

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>)

sureshg avatar Apr 16 '21 07:04 sureshg

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 avatar Nov 12 '22 21:11 ptrckSTL

@ptrckSTL wow..thanks very much, that worked! It's really weird that it worked after removing the valid comments 😄

sureshg avatar Nov 13 '22 04:11 sureshg