electron-vue icon indicating copy to clipboard operation
electron-vue copied to clipboard

ipcMain.send undefined function

Open rajjagani021 opened this issue 3 years ago • 2 comments
trafficstars

Found an issue or bug with electron-vue? Tell me all about it!

I am passing ipcMain.send('ping') to the vue component but it keeps throwing the error as attached to the screenshot, even mainWindow.webContents.send('ping')` not working as well.

How can I reproduce this problem?

# In Main.js

app.on('ready', async ()=>{

  await createWindow();
  mainWindow.webContents.send('ping', 'whoooooooh!');
  ipcMain.send('deep-link-url',"home");

});

In App.vue

this.$electron.ipcRenderer.on('deep-link-url', (event, arg) => {
      console.log(arg);
      this.$router.push({ name: 'dee[link' })
 });
If visual, provide a screenshot.

#

ipc_error

Tell me about your development environment.
  • Node version: 14.17.3
  • NPM version: 6.14.3
  • vue-cli version: (if necessary)
  • Operating System: macOS catalina 10.15

rajjagani021 avatar May 15 '22 06:05 rajjagani021

`

Elektron-vue ile ilgili bir sorun veya hata mı buldunuz? Bana ondan bahset!

mainWindow.webContents.send ipcMain.send('ping') to the vue component but it keeps throwing the error as attached to the screenshot, even ('ping')` iletisini iletiyorum ve çalışmıyor.

Bu sorunu nasıl yeniden oluşturabilirim?

Main.js'de

app.on('ready', async ()=>{

  await createWindow();
  mainWindow.webContents.send('ping', 'whoooooooh!');
  ipcMain.send('deep-link-url',"home");

});

App.vue'da

this.$electron.ipcRenderer.on('deep-link-url', (event, arg) => {
      console.log(arg);
      this.$router.push({ name: 'dee[link' })
 });
Görsel ise, bir ekran görüntüsü sağlayın.

ipc_hatası

Bana geliştirme ortamınızdan bahsedin.
  • Düğüm sürümü: 14.17.3
  • NPM sürümü: 6.14.3
  • vue-cli versiyonu: (gerekirse)
  • İşletim Sistemi: macOS catalina 10.15

Khasimovf avatar May 18 '22 12:05 Khasimovf

Uploading Screenshot_20220518-165130_Chrome.jpg…

Khasimovf avatar May 18 '22 12:05 Khasimovf