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

build: @magic-sdk/[email protected] fails due to missing exports from @magic-sdk/types #847

Closed
3 tasks done
drichar opened this issue Jan 10, 2025 · 2 comments
Closed
3 tasks done

Comments

@drichar
Copy link

drichar commented Jan 10, 2025

โœ… Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-sdk)?

๐Ÿ› Description

After upgrading to @magic-sdk/[email protected], builds are failing due to missing exports Events and Wallets enums from @magic-sdk/types. These exports appear to have been removed in PR #742 ("add web3modal extension").

For context:

  • Our library only uses type imports from @magic-sdk/provider:
    import type { InstanceWithExtensions, SDKBase } from '@magic-sdk/provider'
  • The build error occurs because @magic-sdk/provider's distributed code (dist/es/index.mjs) is making runtime imports of the removed exports from @magic-sdk/types.

๐Ÿงฉ Steps to Reproduce

  1. Install @magic-sdk/[email protected] in a project
  2. Build the project using a bundler (in our case, tsup/esbuild)
  3. Observe build errors about missing exports

๐Ÿค” Expected behavior

The build should complete successfully, as it did with previous versions of @magic-sdk/provider.

๐Ÿ˜ฎ Actual behavior

Build fails with the following errors:

โœ˜ [ERROR] No matching export in "@magic-sdk/types/dist/es/index.mjs" for import "Events"
โœ˜ [ERROR] No matching export in "@magic-sdk/types/dist/es/index.mjs" for import "Wallets"

๐Ÿ’ป Code Sample

An example of this failure can be seen in our CI build:
https://github.com/TxnLab/use-wallet/actions/runs/12703649974/job/35411786801?pr=324

Source code:
https://github.com/TxnLab/use-wallet/blob/main/packages/use-wallet/src/wallets/magic.ts

๐ŸŒŽ Environment

Software Version(s)
@magic-sdk/provider 28.19.0
@magic-sdk/types 24.18.0
Build Tool tsup 8.3.5/esbuild 0.24.0
Operating System Linux (CI)
@hcote
Copy link
Contributor

hcote commented Jan 10, 2025

Hi @drichar, PR #742 updated the @magic-sdk/provider package to version 28.20.0 - if you install that version, does this fix your build issue?

@drichar
Copy link
Author

drichar commented Jan 10, 2025

Yes it does. Apologies for not realizing that Renovate wasn't installing the latest versions of all packages. After manually upgrading to the latest versions of @magic-ext/algorand, magic-sdk, and @magic-sdk/provider, the builds are successful. Thank you for your help! Closing the issue.

@drichar drichar closed this as completed Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants