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

Browser Compatibility: Conflicting TypeScript Declarations and Node.js Module Dependencies in Browser Context #549

Open
wdcurry opened this issue Dec 14, 2024 · 1 comment

Comments

@wdcurry
Copy link

wdcurry commented Dec 14, 2024

hey folks, i am exploring using these sdks to get rolling into teaching myself more of the react dapp arena within multiversX. Using AI to explore. We are revealing a few issues that might need addressing, although i admittedly am more of an old-school iOS dev getting my feet wet here.

This was encountered while implementing the wallet connection features using @multiversx/sdk-extension-provider and related packages in a Vite/React application.

Looking at the console logs and build errors, there appear to be several systemic issues that would be worth reporting to the MultiversX SDK team:

The TypeScript type declarations in the SDK seem to have conflicting definitions for the window.elrondWallet property. The error "All declarations of 'elrondWallet' must have identical modifiers" suggests that there are multiple competing type declarations between our code and the SDK's internal types.

There are multiple warnings about externalized modules for browser compatibility (stream, util, events) which suggest the SDK might need better browser-specific polyfills or alternative implementations for these Node.js modules.

The errors we're seeing are typical of packages that were primarily developed for Node.js environments being used in browser contexts without proper browser-specific implementations.

I would recommend reporting these issues to the MultiversX SDK team, specifically:

The conflicting TypeScript declarations for window.elrondWallet
The browser compatibility issues with Node.js core modules
The need for better browser-specific type definitions

I hope this makes more sense to you'all than it does to me at this point in my educational efforts. I was surprised to still see Elrond in the code though!

drew..

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

2 participants
@wdcurry and others