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

fix FailoverRpcProvider import #1182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kdonthi
Copy link

@kdonthi kdonthi commented Aug 27, 2024

Thanks for taking the time to submit a pull request!

If you haven't already, be sure to take a look at the CONTRIBUTING documentation to get up to speed with the practices in this repository.

When you're ready, switch to the "Preview" tab to select an applicable template:

@andy-haynes
Copy link
Contributor

What problem does this address? That class is just re-exported from near-api-js, so this change should be a no-op.

Importing it like this only adds a dependency reference without adding it to package.json.

@kdonthi
Copy link
Author

kdonthi commented Aug 28, 2024

What problem does this address? That class is just re-exported from near-api-js, so this change should be a no-op.

Importing it like this only adds a dependency reference without adding it to package.json.

I keep getting this error in the console whenever I start the multichain example and I end up just having to manually make that change in the node_modules

TypeError: nearAPI.providers.FailoverRpcProvider is not a constructor at new Provider (index.js:41:21) at index.js:3054:15 at Generator.next (<anonymous>) at fulfilled (index.js:27:58)

Maybe am I doing something wrong to begin with? 😅

@andy-haynes
Copy link
Contributor

My guess is this happens because nearAPI is referencing an older version of near-api-js (one which doesn't export FailoverRpcProvider) but somehow there is a more recent version of @near-js/providers installed as a secondary dependency. So it's important to determine where the issue originates because a fix like this, while convenient, further compounds the dependency issue.

Is there a GitHub issue you could link to this PR where you describe the problem in more detail? Would you mind please creating one if it does not exist and link it to this PR? I'm not sure how to reproduce this from your description.

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

Successfully merging this pull request may close these issues.

2 participants