electron-vite/electron-vite-react

[Help] Failed preload + window.ipcRenderer is undefined

alexander-ye opened this issue · 1 comments

Screenshot 2024-02-17 at 10 55 06

On initialization (using yarn install and yarn run dev), I receive a sequence of errors:

VM123 sandbox_bundle:2 Unable to load preload script: /Users/aerypro/git/acwms-electron/dist-electron/preload/index.mjs
Error: ENOENT: no such file or directory, open '/Users/aerypro/git/acwms-electron/dist-electron/preload/index.mjs'
chunk-PP72ARUD.js?v=6603f438:16657 Uncaught TypeError: Cannot read properties of undefined (reading 'on')
    at index.tsx:89:24
    at commitHookEffectListMount (chunk-PP72ARUD.js?v=6603f438:16902:34)
    at commitPassiveMountOnFiber (chunk-PP72ARUD.js?v=6603f438:18150:19)
    at commitPassiveMountEffects_complete (chunk-PP72ARUD.js?v=6603f438:18123:17)
    at commitPassiveMountEffects_begin (chunk-PP72ARUD.js?v=6603f438:18113:15)
    at commitPassiveMountEffects (chunk-PP72ARUD.js?v=6603f438:18103:11)
    at flushPassiveEffectsImpl (chunk-PP72ARUD.js?v=6603f438:19484:11)
    at flushPassiveEffects (chunk-PP72ARUD.js?v=6603f438:19441:22)
    at chunk-PP72ARUD.js?v=6603f438:19322:17
    at workLoop (chunk-PP72ARUD.js?v=6603f438:195:42)

and a bunch of other errors that start with a failed preload. How to address?

Full logs:
Screenshot 2024-02-17 at 10 57 45

  1. First, make sure that you execute all the 'yarn install' correctly and correctly.
  2. You may need to pay attention to your Node.js version in addition to this(recommended versions 18-20).

image