[jsdom] Fixes to compiler errors for Window object#57466
Conversation
Fix error messages: ``` node_modules/@types/jsdom/base.d.ts(192,18): error TS2411: Property '["Infinity"]' of type 'number' is not assignable to 'number' index type 'Window'. node_modules/@types/jsdom/base.d.ts(193,18): error TS2411: Property '["NaN"]' of type 'number' is not assignable to 'number' index type 'Window'. ```
|
Did you find a solution ? Because, we experience the same problem on our nestJs project. |
|
@paullemoine3 not yet, I have start a discussions here: #57467 Please also let me know if you have a solution |
|
@paullemoine3 Do you use the module yourself or is it just a dependency of one of your dependencies ? I had this problem today but when I checked which modules use |
|
It's actually v27.4.3 that drops the js-dom dependency and thus fixes the problem. |
|
The problem is still present for those who have to use js-dom :( |
node_modules/@types/jsdom/base.d.ts:194:18 - error TS2411: Property '["Infinity"]' of type 'number' is not assignable to 'number' index type 'Window'.
194 readonly ["Infinity"]: number;
~~~~~~~~~~~~
node_modules/@types/jsdom/base.d.ts:195:18 - error TS2411: Property '["NaN"]' of type 'number' is not assignable to 'number' index type 'Window'.
195 readonly ["NaN"]: number;
~~~~~~~Latest JSDOM, latest types, same old error. Is there any point opening a new ticket if this one was closed without reason? |
|
Do I have to do as the VSCode Jupyter folk are doing here, and physically re-write the file in question to fix this issue, on every install? |
this is what my package.json looks like I'm still facing this issue, has there been any resolution to this issue? |
When I want to use @types/jsdom in my nest.js project, I get the following error messages:
I am not the only one who has this problem, here is a patch that includes the same changes as this pull request: microsoft/vscode-jupyter#7986
Please fill in this template.
npm test <package to test>.Select one of these and delete the others:
If adding a new definition:
.d.tsfiles generated via--declarationdts-gen --dt, not by basing it on an existing project.tslint.jsonshould contain{ "extends": "dtslint/dt.json" }, and no additional rules.tsconfig.jsonshould havenoImplicitAny,noImplicitThis,strictNullChecks, andstrictFunctionTypesset totrue.If changing an existing definition:
If removing a declaration:
notNeededPackages.json.