TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
npm run fetch-mdn fails
Hi, I wanted to update type-definitions for #875 and first fetch the latest specs and build my own version. The command npm run fetch-mdn
fails with the following message:
WebIDLParseError: Syntax error at line 1:
WebIDL[Exposed=Window
^ Unrecognised tokens
at tokeniser_Tokeniser.error (G:\...\TSJS-lib-generator\node_modules\webidl2\dist\webidl2.js:1:2
0350)
at r (G:\...\TSJS-lib-generator\node_modules\webidl2\dist\webidl2.js:1:33487)
at L (G:\...\TSJS-lib-generator\node_modules\webidl2\dist\webidl2.js:1:34464)
at Module.q (G:\...\TSJS-lib-generator\node_modules\webidl2\dist\webidl2.js:1:34604)
at Object.convert (G:\...\TSJS-lib-generator\lib\widlprocess.js:26:31)
at convertWidl (G:\...\TSJS-lib-generator\lib\index.js:96:38)
at Array.map (<anonymous>)
at emitDom (G:\...\TSJS-lib-generator\lib\index.js:89:42)
at Object.<anonymous> (G:\...\TSJS-lib-generator\lib\index.js:227:1)
at Module._compile (internal/modules/cjs/loader.js:1133:30) {
bareMessage: 'Unrecognised tokens',
context: 'Syntax error at line 1:\nWebIDL[Exposed=Window\n^',
line: 1,
sourceName: undefined,
input: 'WebIDL[Exposed=Window',
tokens: [
{
type: 'identifier',
value: 'WebIDL',
trivia: '',
line: 1,
index: 0
},
{ type: '[', value: '[', trivia: '', line: 1, index: 1 },
{
type: 'identifier',
value: 'Exposed',
trivia: '',
line: 1,
index: 2
},
{ type: '=', value: '=', trivia: '', line: 1, index: 3 },
{
type: 'identifier',
value: 'Window',
trivia: '',
line: 1,
index: 4
}
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tsjs-lib-generator@ build: `tsc -p ./tsconfig.json && node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tsjs-lib-generator@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\...\npm-cache\_logs\2020-06-21T15_30_47_360Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tsjs-lib-generator@ fetch-mdn: `npm run build && node ./lib/mdnfetcher.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tsjs-lib-generator@ fetch-mdn script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\...\npm-cache\_logs\2020-06-21T15_30_47_387Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tsjs-lib-generator@ fetch: `echo This could take a few minutes... && npm run fetch-idl && npm run fetch-mdn
`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tsjs-lib-generator@ fetch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\...\npm-cache\_logs\2020-06-21T15_30_47_414Z-debug.log
Tested on these machines:
os: Windows 10 Pro
node: v12.16.3
npm: 6.14.5
os: Ubuntu 18.04.4 LTS
node: v10.21.0
npm: 6.14.4
The error message is the same. The problem can (hopefully) be reproduced using
npm run install && npm run fetch # Or npm run fetch-mdn