js-algorand-sdk icon indicating copy to clipboard operation
js-algorand-sdk copied to clipboard

Typescript error on deployment to AWS

Open berkaytheunicorn opened this issue 3 years ago • 8 comments

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

berkaytheunicorn avatar Sep 01 '22 11:09 berkaytheunicorn

Exact same problem here, but it is during build time. Not specific to an AWS deployment

mploux avatar Sep 02 '22 07:09 mploux

@berkaey and @mploux do you have any more info on this? a longer stack trace even?

barnjamin avatar Sep 02 '22 11:09 barnjamin

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

berkaytheunicorn avatar Sep 02 '22 11:09 berkaytheunicorn

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

hernandp avatar Sep 02 '22 18:09 hernandp

UPDATE: Upgraded to Typescript 4.7.4, error gone.

hernandp avatar Sep 02 '22 18:09 hernandp

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.`

Vidhyanandcs avatar Sep 06 '22 07:09 Vidhyanandcs

UPDATE: Upgraded to Typescript 4.7.4, error gone.

Worked for me

Vidhyanandcs avatar Sep 06 '22 07:09 Vidhyanandcs

Had the same problem with typescript 4.8.2. Downgraded to 4.7.4 and it's gone.

oliviera9 avatar Sep 20 '22 10:09 oliviera9

I'm seeing this too, it occurs at the original local build time but prevents publishing to Firebase Functions as well.

alistairheath avatar Nov 30 '22 18:11 alistairheath

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/*"],
  }

AwolDes avatar Jan 12 '23 00:01 AwolDes

Getting same error with Angular Version: 15.2.2 Algosdk: 2.0.0 Typescript: 4.8.4

ghost avatar Mar 21 '23 10:03 ghost

@kalp-lathia this should be corrected in the next release (2.2.0), expecting it today or tomorrow

barnjamin avatar Mar 21 '23 10:03 barnjamin

If this is fully resolved as of 2.2.0 we can close this. Is anyone still facing this issue?

Eric-Warehime avatar Apr 28 '23 16:04 Eric-Warehime

Closing--please re-open if you continue to see this same issue occurring when using v 2.2.0.

Eric-Warehime avatar May 05 '23 16:05 Eric-Warehime