In my Meteor/React project I have the following line:
let gameId = window.prompt("Please enter the ID of the game you wish to load.");
TypeScript gives the transpiling error Cannot find name 'window'.
I am using barbatus/typescript, with default compiler options:
{
"module": "commonjs",
"target": "es5",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": true
}
I tried creating a tsconfig.json in the root of my Meteor project, copying the above compiler options but appending the line:
"lib": ["es2015",
"dom"]
However, the error remains.
tsconfig.jsonto your question, even if it's in the linktsconfig.jsonmust have "dom"compilerOptionsin tsconfig.json ascompilerOptionsproperty,not the root json.