nervosnetwork / neuron

Neuron: Nervos CKB Wallet
https://www.nervos.org
MIT License
188 stars 82 forks source link

Start according to the prompt, but create a wallet with an error, and a screenshot of the error #2338

Closed zhb666 closed 2 years ago

zhb666 commented 2 years ago

image Import the wallet, create a new wallet and report an error

Keith-CY commented 2 years ago

Hi @zhb666, is this a screenshot of browser but not an electron's window?

If yes, this exception is reasonable since ipcRenderer is an object injected from electron's main process into electron's renderer process, which means ipcRenderer.invoke is available only in electron's window while undefined.invoke will be called in browsers.

This usually happens on running npm run start in packages/neuron-ui to start the UI independently. Please run npm run start in the root dir and an electron's window should prompt.

zhb666 commented 2 years ago

Thanks for the reply, I switched to the root directory to start, I also started electron and mainWindow.loadURL("http://localhost:3000"); but this error is still reported

image
Keith-CY commented 2 years ago

Thanks for the reply, I switched to the root directory to start, I also started electron and mainWindow.loadURL("http://localhost:3000"); but this error is still reported

image

It's kind of weird.

This error indicates that ipcRenderer is not injected into the window, which should be caused by error on loading preload.js(https://github.com/nervosnetwork/neuron/blob/38b6afeb965d1befbb1437c9e2d1503099153e0c/packages/neuron-wallet/src/controllers/app/index.ts#L132)

Could you add some logs in https://github.com/nervosnetwork/neuron/blob/38b6afeb965d1befbb1437c9e2d1503099153e0c/packages/neuron-wallet/src/controllers/app/preload.ts to see if this file is executed on instantiating the main window?

zhb666 commented 2 years ago

I found the problem. I opened an online version locally to download and install the neuron program, and then the program couldn't be opened after startup. I don't know why this problem would conflict. Just turn off the installed neuron