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

Attempted import error: 'TokenInfo' is not exported from '@injectivelabs/token-metadata' (imported as 'TokenInfo') #3927

Open
oxrajesh opened this issue May 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@oxrajesh
Copy link

oxrajesh commented May 3, 2024

Description and context

Trying to build a NextJS project and got this error

`./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/DenomClient.js
Attempted import error: 'TokenInfo' is not exported from '@injectivelabs/token-metadata' (imported as 'TokenInfo').

Import trace for requested module:
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/DenomClient.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/index.js
./node_modules/@certusone/wormhole-sdk/lib/esm/token_bridge/injective.js
./node_modules/@certusone/wormhole-sdk/lib/esm/token_bridge/index.js
./node_modules/@certusone/wormhole-sdk/lib/esm/index.js`

Node Version:
20.9.0

Npm Version:
10.1.0

OS:
Mac

NPM Package Version:
^0.10.15

Steps to reproduce

  1. Install "@certusone/wormhole-sdk": "^0.10.15",
  2. Yarn build / npm run build

Experienced behavior

Got this error:
`./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/DenomClient.js
Attempted import error: 'TokenInfo' is not exported from '@injectivelabs/token-metadata' (imported as 'TokenInfo').

Import trace for requested module:
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/DenomClient.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/Denom/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/utils/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/core/index.js
./node_modules/@certusone/wormhole-sdk/node_modules/@injectivelabs/sdk-ts/dist/esm/index.js
./node_modules/@certusone/wormhole-sdk/lib/esm/token_bridge/injective.js
./node_modules/@certusone/wormhole-sdk/lib/esm/token_bridge/index.js
./node_modules/@certusone/wormhole-sdk/lib/esm/index.js

Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Expected behavior

Should be successfully

Solution recommendation

@oxrajesh oxrajesh added the bug Something isn't working label May 3, 2024
@tonyjin
Copy link

tonyjin commented May 15, 2024

Can you try using the new TS SDK (https://github.com/wormhole-foundation/wormhole-sdk-ts) and see if you still run into this error?

https://docs.wormhole.com/wormhole/reference/sdk-docs

This new SDK have better devX for most use cases.

@artursapek
Copy link
Contributor

I ran into this error myself. it happens because Injective team misused semver in their own packages and made breaking changes in a minor version update while using the caret ^ notation (which allows for minor version bumps).

I fixed it in my situation using overrides: https://github.com/wormhole-foundation/wormhole-connect/pull/2090/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R34-R36

maybe that helps?

@dev-johnny-gh
Copy link

I ran into this error myself. it happens because Injective team misused semver in their own packages and made breaking changes in a minor version update while using the caret ^ notation (which allows for minor version bumps).

I fixed it in my situation using overrides: https://github.com/wormhole-foundation/wormhole-connect/pull/2090/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R34-R36

maybe that helps?

Thanks a lot. I can't believe this will happen in 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants