Programming Language/electron

[Electron] require is not defined 해결 방법

발효홍삼 2022. 12. 13. 00:24
728x90

Electron openDevTools 를 이용하여 F12 메뉴를 보는데 require is not defined 경고를 만났다.

이 에러는 main.js의 webPreferences에 아래 두 코드를 입력해주면 해결 가능하다.

 nodeIntegration:false
 contextIsolation : false
728x90