js-algorand-sdk
js-algorand-sdk copied to clipboard
Typescript error on deployment to AWS
I'm getting this error while deploying to AWS ElasticBeanstalk environment. BTW, In local, it works perfectly.
node_modules/algosdk/dist/types/src/types/utils.d.ts(19,84): error TS2344: Type 'K' does not satisfy the constraint 'Partial<T>'.
Local Environment
TS: 4.6.3
Node: 16.4
SDK: 1.19.1
EB Environment
TS: 4.6.3
Node: 16 running on 64bit Amazon Linux 2/5.5.5 (arm64)
SDK: 1.19.1
Exact same problem here, but it is during build time. Not specific to an AWS deployment
@berkaey and @mploux do you have any more info on this? a longer stack trace even?
I'm not sure it is directly related to algo-sdk because after I forced ts version to 4.7.4 and removing node_modules from tsconfig paths the error disappeared
Same problem, output:
node_modules/algosdk/dist/types/src/types/utils.d.ts:19:84 - error TS2344: Type 'K' does not satisfy the constraint 'Partial<T>'.
19 export declare type DistributiveOverwrite<T, K> = T extends unknown ? Overwrite<T, K> : never;
~
node_modules/algosdk/dist/types/src/types/utils.d.ts:19:46
19 export declare type DistributiveOverwrite<T, K> = T extends unknown ? Overwrite<T, K> : never;
~
This type parameter might need an `extends Partial<T>` constraint.
Node 16.16, Typescript 4.6.2
UPDATE: Upgraded to Typescript 4.7.4, error gone.
i am using typescript 4.8.2 node 16.14.2 Got the same error while trying to build locally
`node_modules/algosdk/dist/types/src/types/utils.d.ts:19:84 - error TS2344: Type 'K' does not satisfy the constraint 'Partial<T>'.
19 export declare type DistributiveOverwrite<T, K> = T extends unknown ? Overwrite<T, K> : never;
~
node_modules/algosdk/dist/types/src/types/utils.d.ts:19:46
19 export declare type DistributiveOverwrite<T, K> = T extends unknown ? Overwrite<T, K> : never;
This type parameter might need an `extends Partial<T>` constraint.`
UPDATE: Upgraded to Typescript 4.7.4, error gone.
Worked for me
Had the same problem with typescript 4.8.2. Downgraded to 4.7.4 and it's gone.
I'm seeing this too, it occurs at the original local build time but prevents publishing to Firebase Functions as well.
UPDATE: Upgraded to Typescript 4.7.4, error gone.
Pinning to this version worked for me as well, an this is the tsconfig just in case it helps others
{
"ts-node": {
// these options are overrides used only by ts-node
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
"compilerOptions": {
"module": "commonjs"
}
},
"compilerOptions": {
"target": "ES2015",
"module": "ES2020",
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"declarationDir": "./lib/types",
"outDir": "./lib/esm",
"strict": true,
"noImplicitAny":true,
"strictNullChecks": true,
"esModuleInterop": true,
"allowJs": true,
"lib": [ "es2015","DOM" ],
"allowSyntheticDefaultImports": true
// "types": ["jest", "@types/node","reflect-metadata"]
},
"include": ["src/**/*", "src/__tests__/t-tests.ts"],
"exclude": ["node_modules", "**/__tests__/*", "src/build/*"],
}
Getting same error with Angular Version: 15.2.2 Algosdk: 2.0.0 Typescript: 4.8.4
@kalp-lathia this should be corrected in the next release (2.2.0), expecting it today or tomorrow
If this is fully resolved as of 2.2.0 we can close this. Is anyone still facing this issue?
Closing--please re-open if you continue to see this same issue occurring when using v 2.2.0.