You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
I used nginx reverse proxy to deal with cross-domain problems, but web3.js request https://xxx.xxx/5b44529e903c4ebf9d60e4d01c965489 throw "Uncaught Error: Can't autodetect provider for "xxx.xxx/5b44529e903c4ebf9d60e4d01c965489""
#The cross-domain configuration of nginx is as follows
import data from './abi'
import Web3 from 'web3';
export default {
install: function (Vue, options) {
var web3 = window.web3;
var contract = '';
//web3 = new Web3("https://mainnet.infura.io /v3/5b44529e903c4ebf9d60e4d01c965489");
web3 = new Web3("www.xxx.xxx/5b44529e903c4ebf9d60e4d01c965489");
contract = new web3.eth.Contract(data.abi, data.address);
Vue.prototype.infuraContract = contract;
Vue.prototype.infuraWeb3 = web3;
//Web3 version "web3": "^1.0.0-beta.36";
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I used nginx reverse proxy to deal with cross-domain problems, but web3.js request https://xxx.xxx/5b44529e903c4ebf9d60e4d01c965489 throw "Uncaught Error: Can't autodetect provider for "xxx.xxx/5b44529e903c4ebf9d60e4d01c965489""
#The cross-domain configuration of nginx is as follows
#web3.js code
The text was updated successfully, but these errors were encountered: