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

Can't import whold sdk module in React #931

Open
acharb opened this issue Mar 20, 2024 · 1 comment
Open

Can't import whold sdk module in React #931

acharb opened this issue Mar 20, 2024 · 1 comment
Labels

Comments

@acharb
Copy link

acharb commented Mar 20, 2024

Describe the bug
When trying to import the entire sdk in React or React native, it returns undefined. NodeJS environment it works as expected
(not sure if this is a bug or if on purpose tbh)

What version are you on?
11.2.2

To Reproduce

// React or React Native environment
import StellarSdk from "@stellar/stellar-sdk";

console.log({ StellarSdk }); // returns undefined
// NodeJS
import StellarSdk from "@stellar/stellar-sdk";

console.log({ StellarSdk }); // returns values as expected

note: for any environment importing de-structured modules works fine

Expected behavior
For it to always return the same regardless of environment

@Shaptic
Copy link
Contributor

Shaptic commented Mar 20, 2024

Hmm I'm surprised this even worked on Node honestly. It should be import * as StellarSdk from ... everywhere ever since the Webpack 5 refactor.

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

No branches or pull requests

2 participants