Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems getting Arquero to find it's types in Typescript #332

Open
mishatsvelik opened this issue Jul 6, 2023 · 5 comments
Open

Problems getting Arquero to find it's types in Typescript #332

mishatsvelik opened this issue Jul 6, 2023 · 5 comments

Comments

@mishatsvelik
Copy link

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;
~~~~~~~~~~~~~

@mishatsvelik
Copy link
Author

To reproduce this:

  1. Installed arquero to my Typescript project through the CLI: npm install arquero --save
  2. Added import * as aq from 'arquero' to index.ts
  3. Then if you go to node_modules/arquero/dist/types/op/window-functions.d.ts can see WindowState is highlighted red: type WindowState = /*unresolved*/ any

@coreboarder
Copy link

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

@coreboarder
Copy link

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

@atmgrifter00
Copy link

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.

@rajsite
Copy link

rajsite commented Mar 20, 2024

Looks like #346 may address this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants