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

Error: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined #6185

Closed
sampathkumar7 opened this issue Jun 10, 2023 · 5 comments
Assignees
Labels
4.x 4.0 related

Comments

@sampathkumar7
Copy link

Logs

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:89:110 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

89 getAddress(ENSName: string, coinType?: number): Promise<import("web3-types").MatchPrimitiveType<"bytes", unknown>>;
~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:106:114 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

106 getPubkey(ENSName: string): Promise<unknown[] & Record<1, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<0, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & [] & Record<"x", import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<"y", import("web3-types").MatchPrimitiveType<"bytes32", unknown>>>;
~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:106:187 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

106 getPubkey(ENSName: string): Promise<unknown[] & Record<1, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<0, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & [] & Record<"x", import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<"y", import("web3-types").MatchPrimitiveType<"bytes32", unknown>>>;
~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:106:267 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

106 getPubkey(ENSName: string): Promise<unknown[] & Record<1, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<0, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & [] & Record<"x", import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<"y", import("web3-types").MatchPrimitiveType<"bytes32", unknown>>>;

                                                              ~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:106:342 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

106 getPubkey(ENSName: string): Promise<unknown[] & Record<1, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<0, import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & [] & Record<"x", import("web3-types").MatchPrimitiveType<"bytes32", unknown>> & Record<"y", import("web3-types").MatchPrimitiveType<"bytes32", unknown>>>;

                                                                                                                                         ~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:118:95 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

118 getContenthash(ENSName: string): Promise<import("web3-types").MatchPrimitiveType<"bytes", unknown>>;
~~~~~~~

Error: node_modules/web3-eth-ens/lib/commonjs/ens.d.ts:142:118 - error TS2344: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined'.

142 supportsInterface(ENSName: string, interfaceId: string): Promise<import("web3-types").MatchPrimitiveType<"bool", unknown>>;
~~~~~~~

Environment

Angular 16, nodejs 18

@jdevcs
Copy link
Contributor

jdevcs commented Jun 10, 2023

For time being you may use "skipDefaultLibCheck": true, or "skipLibCheck": true in your tsconfig.

@jdevcs jdevcs added the 4.x 4.0 related label Jun 10, 2023
Muhammad-Altabba added a commit to Muhammad-Altabba/ChainTrust that referenced this issue Jun 11, 2023
Skipping the lib check till the following issues identified here are resolved:
 - web3/web3.js#6162
 - web3/web3.js#6185
@jdevcs jdevcs self-assigned this Jun 12, 2023
@Muhammad-Altabba Muhammad-Altabba changed the title Angular 16 build error Error: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined Jun 12, 2023
@Muhammad-Altabba
Copy link
Contributor

I updated the issue title as this is not specific to Angular.
And here is a project that faces the same issue: https://github.com/Themvp07/ChainTrust/tree/QR_PluginWeb3 (run yarn build to see the errors). And adding "skipLibCheck": true could solve the issue in the mean time.

@Muhammad-Altabba Muhammad-Altabba added Good First Issue Great to learn the internals of web3.js Discussion labels Jun 12, 2023
@jdevcs jdevcs removed the Good First Issue Great to learn the internals of web3.js label Jun 12, 2023
@jdevcs
Copy link
Contributor

jdevcs commented Jun 12, 2023

This error is occurring if user proj is using typescript 5.x and doesn't occur if user project is on typescript 4.x ( same version like web3.js is using ).

@jdevcs jdevcs mentioned this issue Jun 12, 2023
17 tasks
@jdevcs
Copy link
Contributor

jdevcs commented Jun 12, 2023

There are breaking changes in typescript v5 as compared to v4, I created a test PR #6192

@jdevcs
Copy link
Contributor

jdevcs commented Jun 12, 2023

we can apply a fix in current web3 with ts v4, for running in ts v5, instead of shifting web3-4x to ts 5x yet, I'll check it later.

@jdevcs jdevcs mentioned this issue Jun 13, 2023
17 tasks
@jdevcs jdevcs removed the Discussion label Jun 13, 2023
@jdevcs jdevcs closed this as completed Jun 15, 2023
@jdevcs jdevcs mentioned this issue Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

No branches or pull requests

3 participants