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.

Default export / TS types definition mismatches in Web3 sub-modules #3606

@cgewecke

Description

@cgewecke

This is a tracking issue for the general problem described in #3587.

The current types definitions for sub-modules listed below cause TS to miscompile the class constructors, throwing an error like:

Uncaught TypeError: web3_eth_abi__WEBPACK_IMPORTED_MODULE_1__.AbiCoder is not a constructor

The root package is unaffected.

Package Widely used
web3-bzz
web3-core-method
web3-eth ✅ (#3198)
web3-eth-abi ✅ (#3587)
web3-eth-accounts ✅ (#3292)
web3-eth-contract
web3-eth-ens
web3-eth-iban
web3-eth-personal
web3-net
web3-providers-http
web3-providers-ws ✅ (#3215)
web3-providers-ipc
web3-shh

Notes:

  • This issue needs further analysis - there may be a way to rewrite the types or require a ts-config setting or some combination of the two which can resolve this in a non-breaking fashion.
  • Web3 should have some kind of ts-node based smoke test for sub-module usability. The existing typedef tests failed to catch the problem e.g the current definitions tsc (without error) down to unusable code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.x1.0 related issuesStaleHas not received enough activityTypesIncorrect or missing types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions