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

TypeError: Cannot read properties of undefined (reading 'Event') #44

Open
cchyung opened this issue Oct 22, 2021 · 1 comment
Open

TypeError: Cannot read properties of undefined (reading 'Event') #44

cchyung opened this issue Oct 22, 2021 · 1 comment

Comments

@cchyung
Copy link

cchyung commented Oct 22, 2021

Running into this issue when trying to use the opensea-js library. The error only shows up on build (svelte-kit).

It looks like it's erroring out when trying to import schemas/main/CryptoKitties/index.ts

It's saying that Web3.abi is undefined:

...
  events: {
    transfer: [{
      type: Web3.AbiType.Event,
      name: 'Transfer',
      target: '0x06012c8cf97bead5deae237070f9587f8e7a266d',
      anonymous: false,
      inputs: [
...

I have already installed web3 separately and made sure it's present in node modules. I'm not sure why that import would be coming back empty.

@cchyung
Copy link
Author

cchyung commented Oct 23, 2021

If others face this issue. A manual replace of AbiType.Event with 'event' and AbiType.Function with 'function' resolved these issues. Looks like the AbiType dict is exported at dist/index.js but for some reason with vite that wasn't working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant