path.join error in Electron's ipcRenderer

503 views Asked by At

I am creating a Windows app using Electron, React, and Vite.
Currently I'm just learning it.

In my App.jsx file, when I am importing ipcRenderer as import { ipcRenderer } from "electron";; I am getting an error as shown in the image below.

enter image description here

How should I solve this problem?

1

There are 1 answers

0
init-qy On

I use require to fix it.

const { ipcRenderer } = require('electron')