Closed theoboldfrazier closed 2 years ago
Could you please post the code of how you are instantiating the Yearn SDK object?
We instantiate it in a few of our packages, but each time follows this pattern.
const network = 1 // 1 for mainnet
const provider = new JsonRpcProvider(process.env.REACT_APP_ETHEREUM_NODE_URL)
export const yearnSdk = new Yearn(network, { provider, disableAllowlist: true })
REACT_APP_ETHEREUM_NODE_URL is defined and a correct URL to our eth node.
We instantiate it in this repo https://github.com/shapeshift/lib, which has packages used in our web repo here: https://github.com/shapeshift/web
When we deploy it to the cloud here https://app.shapeshift.com, you can see in the console there are CSP errors of trying to connect to localhost:8545 (not seen locally because localhost is part of self in local dev). The best we've tracked it down is in the yearn sdk something is trying to connect to a node on localhost.
Found an issue in our libraries where env was injected to our dependencies during local development, but not on the production build. Closing this issue as it was not an issue in the yearn-sdk.
When instantiating the yearn sdk and passing in a JsonRpcProvider to a remote node, the sdk is still attempting to connect to a node at localhost:8545.