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

Error when including both stellar-hd-wallet and stellar-sdk in my project #10

Closed
corymsmith opened this issue Jul 30, 2018 · 10 comments
Closed

Comments

@corymsmith
Copy link

corymsmith commented Jul 30, 2018

When I include both stellar-hd-wallet and stellar-sdk in my project I get errors when requiring them both as stellar-base is included twice, not sure if stellar-base should instead be a peerDependency or how to solve this...

Any suggestions?

Error: XDR Error:Value is already defined
    at TypeBuilder.define (/code/blockchain-client/node_modules/js-xdr/lib/config.js:341:17)
    at TypeBuilder.typedef (/code/blockchain-client/node_modules/js-xdr/lib/config.js:247:14)
    at /code/blockchain-client/node_modules/stellar-hd-wallet/node_modules/stellar-base/lib/generated/stellar-xdr_generated.js:1:259
    at Object.config (/code/blockchain-client/node_modules/js-xdr/lib/config.js:38:5)
    at Object.<anonymous> (//code/blockchain-client/node_modules/stellar-hd-wallet/node_modules/stellar-base/lib/generated/stellar-xdr_generated.js:1:234)

These are the related deps in my package.json:

"stellar-hd-wallet": "0.0.6",
"stellar-sdk": "^0.9.2"
@corymsmith
Copy link
Author

Related to stellar/js-stellar-sdk#191

@chatch
Copy link
Owner

chatch commented Jul 31, 2018

i'm not sure what's going on here. the "TS errors", is that typescript executing the code? or tsc compiling?

@corymsmith
Copy link
Author

This just happens when requiring them. I realized it's not actually TypeScript errors.

@johansten
Copy link
Contributor

I'm getting the same with webpack/babel. The solution was to upgrade stellar-hd-wallet to use the same version of stellar-base as stellar-sdk is using.

@chatch
Copy link
Owner

chatch commented Aug 7, 2018

ok great. thanks @johansten. i'll do a release with this fix now.

@chatch
Copy link
Owner

chatch commented Aug 7, 2018

released 0.0.7 to npm which includes this fix.

@johansten
Copy link
Contributor

I should add that I had to include stellar-base as a dependency in my own project to make sure that stellar-sdk used the top-level instance of the module, instead of creating its own (which would take us back to the initial problem)

@bartekn
Copy link

bartekn commented Aug 8, 2018

Fix ready in stellar/js-xdr#21.

@bartekn
Copy link

bartekn commented Aug 8, 2018

This is fixed in:

@chatch
Copy link
Owner

chatch commented Aug 9, 2018

awesome. thanks @bartekn, i will deploy a new version with the new stellar-base version,

chatch pushed a commit that referenced this issue Aug 9, 2018
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

4 participants