Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

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

Closed

Description

@sampathkumar7

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

Activity

  1. jdevcs commented on Jun 10, 2023

    @jdevcs
    Contributor

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

  2. added a commit that references this issue on Jun 11, 2023
  3. self-assigned this
    on Jun 12, 2023
  4. changed the title [-]Angular 16 build error [/-] [+]Error: Type 'unknown' does not satisfy the constraint 'readonly AbiParameter[] | undefined[/+] on Jun 12, 2023
  5. Muhammad-Altabba commented on Jun 12, 2023

    @Muhammad-Altabba
    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.

  6. jdevcs commented on Jun 12, 2023

    @jdevcs
    Contributor

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

  7. jdevcs commented on Jun 12, 2023

    @jdevcs
    Contributor

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

  8. jdevcs commented on Jun 12, 2023

    @jdevcs
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

4.x4.0 related

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions