javascriptfrontendtypeerrorwebpack-5

Webpack 5 Error after Successful build! ( Uncaught Runtime Error Inpage.js )


I'm using webpack version 5 with:

The console leading me to inpage.js file that I don't have it in my source I assume it's webpack thing (I'm newbie) and the code that cause's error is:

setConnectionUrl() {
                return Nc(this, null, function*() {
                    const {nodes: C} = yield this.bm.emit(Mu.GET_NODE, Ve.solana);
                    this.provider.connection = D1(C[0].url)
                })
            }

The part that giving error cannot read properties of undefined (reading '0') is D1(C[0].url

Console Error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at U1.<anonymous> (inpage.js:28930:39845)
    at Generator.next (<anonymous>)
    at ce (inpage.js:28930:37705)

I tried Updating all of the subpackages like loaders, babels, etc. But it was not helpful. I put my github rep link down here so you can take a look at the source and config file yourself.

Clone: https://github.com/mhmdmsvi24/Front-End-Projects.git

It's my first project and it's in early stages and each time I reload this bug appears I can click on the X and the projects works just fine but It's on my nerve.

I do not have enough reputation to post images please clone the project and check it out!


Solution

  • It so happened that I ran into the same problem a couple of hours ago. However, I seem to have figured it out. In my case, this error was not thrown by my application, but by a third-party browser extension called Trust Wallet. I suspect that you might have the same issue. Just delete it, and the error will go away.