Problems getting Arquero to find it's types in Typescript
I keep on getting messages like this, suggesting that arquero cannot find it's type declarations:
node_modules/arquero/dist/types/op/window-functions.d.ts:25:35 - error TS2304: Cannot find name 'WindowState'.
25 export type WindowValue = (state: WindowState) => any; ~~~~~~~~~~~
node_modules/arquero/dist/types/op/window-functions.d.ts:33:11 - error TS2304: Cannot find name 'AggregateInit'.
33 init: AggregateInit; ~~~~~~~~~~~~~
To reproduce this:
- Installed arquero to my Typescript project through the CLI:
npm install arquero --save - Added
import * as aq from 'arquero'to index.ts - Then if you go to
node_modules/arquero/dist/types/op/window-functions.d.tscan see WindowState is highlighted red:type WindowState = /*unresolved*/ any
This is happening in Angular 17 as well
X [ERROR] TS2304: Cannot find name 'WindowState'. [plugin angular-compiler]
node_modules/arquero/dist/types/op/window-functions.d.ts:25:34:
25 │ export type WindowValue = (state: WindowState) => any;
╵ ~~~~~~~~~~~
tsconfig.json is
/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "esModuleInterop": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", "useDefineForClassFields": false, "lib": [ "ES2022", "dom" ] }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }
The bolded change appears to have fixed the issue for me.
{ "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "esModuleInterop": true, "sourceMap": true, "declaration": false, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "ES2022", "module": "ES2022", "useDefineForClassFields": false, "lib": [ "ES2022", "dom" ], "skipLibCheck": true }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true } }
I'd like to point out that the above bolded change isn't really a fix. It's basically just a way to ignore type errors that Typescript would otherwise report. This is a library that we are trying to uptake, but we are not interested in turning on skipLibCheck, so I'd be interested in an actual solution.
Looks like #346 may address this issue