maxstue / vite-reactts-electron-starter

Starter using Vite2 + React + Typescript + Tailwind + Electron Starter.
MIT License
305 stars 91 forks source link

Uncaught ReferenceError: __dirname is not defined #5

Closed Edric-Li closed 3 years ago

Edric-Li commented 3 years ago

image

maxstue commented 3 years ago

Can you please explain how and what code causes the problem and how to reproduce it?

Do u have a public repo? Than I can check it out

maxstue commented 3 years ago

@Sgout-Li There was a new PR merged, check out if the problem still occures and please give some feedback in here :)

eai04191 commented 3 years ago

This problem is still going on. Just import ipcRenderer and put it in console.log as shown in the screenshot.

2021-07-30_16-20-52

changes: https://github.com/eai04191/vite-reactts-electron-starter/commit/32a9cca1e0f12054de71603e2c24139e205c1aba

maxstue commented 3 years ago

@eai04191 @Sgout-Li This should now be fixed an the main brnach.

But be aware it is not the safest way and you should use the contextIsolation