In My Case I got: app.js:1 Uncaught ReferenceError: require is not defined

86 views Asked by At

I can't found for exactly my example any solution.

app.js:

 const TronWeb = require("tronweb");


const tronWeb = new TronWeb({
    fullHost: "https://api.shasta.trongrid.io"
});


const publicAddress = tronWeb.defaultAddress.base58

console.log(publicAddress);

index.html:

    <script src="tronweb.js"></script>
    <script src="app.js"></script>

localhost/index.html I got error. With using in terminal node app.js works" I want to display in page index.html and is the same way. Maybe missing library? I have tried to transfer from github but I got always the same error.

0

There are 0 answers