Electron Error
2025-01-08
(node:63299) electron: Failed to load URL: file:///home/anne/electron/shortcut-panel/dist/index.html with error: ERR_FILE_NOT_FOUND
(Use `electron --trace-warnings ...` to show where the warning was created)
index.html
, style.css
and script.js
, are not in same location as the javascript files generated by the typescript compiler.
index.html and related files should be in project root. By default, Electron looks for index.html
in same directory as javascript files. However, that file is not being generated using typescript.
Change: win.loadFile('index.html');
to win.loadFile(path.join(__dirname, '../index.html'));
in @/main.ts
.