I don't have lot of experience developping with electron and I'm stuck trying to import 'electron' in a simple React page:
import { ipcRenderer } from 'electron';
export function SpecificationView() {
const saveDataToStorage = () => {
ipcRenderer.send('asynchronous-message', JSON.stringify({ id: 1, name: 'test'}));
};
return (
<div className={styles['container']}>Specs view</div>
);
}
export default SpecificationView;
When the app load, I have a blank page with this error in the console:
For information, the project use vite
and pnpm
.