-
Notifications
You must be signed in to change notification settings - Fork 512
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
2.0@beta error TypeError: Right-hand side of 'instanceof' is not an object #1691
Comments
Hi @dangell7. Thanks for trying out the beta and for opening an issue. Could you give us a little more information regarding the environment you're using xrpl.js in and/or a code snippet to help us reproduce the issue? Thanks again! |
Webpack Config Common Resolve:
Package.json:
getXrpl.js using ripple-lib
The above code works. getXrpl using xrpl:
Notice the resolve fallbacks. net, tls and fs were added for xrpl js. |
So if I change the RippleAPI to Client directly without changing anything else I get:
The url is Then if I change the Client to |
Here is the full error:
|
Is this error from using React, or through regular webpacked code? |
@dangell7 Thank you so much for opening an issue, and providing a lot of relevant information about the issue. I was able to reproduce the issue locally, and should have a fix. It looks like the fix is the same as the fix for another issue we saw with react this morning. We have this fix up in PR at #1694. We'll post in this thread when we publish a Thanks again, |
You guys ROCK!! |
Let us know if this works for you when you get a chance to try it out. |
WOW. What a turn around time.. All good here.. Popping a few errors. I'll post them here but no need to keep this open as the new docs likely already point to the new functions. |
Here is the list of functions I am missing..
@natenichols I read your review comment about balances vs account_info. I have a feeling I will end up using balances more than account info. I can also tell you that this is because I now use currencies more that the native XRP token. So I would assume new developers will gravitate to account_info and later transition to balances when they have a multi currency use case. |
|
We're still working on the full migration docs, but here's a draft of that: https://github.com/XRPLF/xrpl-dev-portal/blob/xrpljs2.0/content/references/xrpljs2-migration-guide.md |
@dangell7 I'm on the team with @mvadari and @natenichols and I'm doing interviews to see what migration problems folks run into. If you're interested, we can migrate some code together 🙂 (Just send me an email at jmills@ripple.com and we can sort out a time) - If you don't want to, no pressure though! |
So just to update we had a meeting today that went really well. I have updated my code base.
Were simple and I do like how the ws/rpc call parameters are what is put into the
These were a little different.
became
A few things to note here is that prepareTransaction using the client, doesn't return an object with an included txJSON object, it returns the final json transaction. I can elaborate. Before prepareTransaction would return something like Another is that wallet.signTransaction doesn't return the full transaction but the signedTransaction. Finally submitTransaction just returned a different kind of result but no issues with that. Still got all the info I need. I also like the outside parameters if I dont care about the result data. Thanks again for your time. |
In case somebody here has the same problem with xrpl.js and SvelteKit (or other Vite-powered FE): https://github.com/XRPLF/xrpl.js/blob/main/packages/xrpl/package.json#L20-L22 A workaround of putting an alias for it manually works (in your vite.config.js): resolve: {
alias: {
// your other aliases
// ...
ws: './node_modules/xrpl/dist/npm/client/WSWrapper.js'
}
}, Vite's repo is aware of that vitejs/vite#7576 (comment) |
I'm not exactly sure what has changed as the docs are still in PR, but when I try
client.connect()
in a web pack application I get the following error:TypeError: Right-hand side of 'instanceof' is not an object
if I leave out connect, then I get a
NotConnectedError
error.Any ideas?
The text was updated successfully, but these errors were encountered: