gurjeetsinghvirdee / eth-fund

Eth Fund - A Decentralized Crowdfunding Platform
https://eth-fund.vercel.app/
MIT License
2 stars 0 forks source link

double check that the address and chainId are correct. #2

Open gurjeetsinghvirdee opened 11 months ago

gurjeetsinghvirdee commented 11 months ago

0x8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx on chain 1, double check that the address and chainId are correct. at fetchContractMetadataFromAddress (contract-publisher-29ba9ed4.browser.esm.js:4854:11)

gurjeetsinghvirdee commented 11 months ago

You can fix that issue by doing some changes on main.jsx

File Path

client/src/main.jsx

First run this command on your client directory

npm install @thirdweb-dev/chains

Then import it just as I did, Replace desiredChainId with activeChain, & remove the ChainID It will solves your issue

import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter as Router } from 'react-router-dom';
import { ChainId, ThirdwebProvider } from '@thirdweb-dev/react';
import { Sepolia } from "@thirdweb-dev/chains";

import { StateContextProvider } from './context';
import App from './App.jsx';
import './index.css';

const root = ReactDOM.createRoot(document.getElementById('root'));

// root.render(
//     <ThirdwebProvider desiredChainId={ChainId.Sepolia}>  // before your code looks like this
//         <Router>
//             <StateContextProvider>
//                 <App />
//             </StateContextProvider>
//         </Router>
//     </ThirdwebProvider>
// )

root.render(
    <ThirdwebProvider activeChain={Sepolia}>  // Now you have to write this
        <Router>
            <StateContextProvider>
                <App />
            </StateContextProvider>
        </Router>
    </ThirdwebProvider>
)