App electron no aceira require()
Ola estou construindo minha primeira app no electron e toda vez que eu uso o require(exemplo: require(''''''''electron'''''''')) ele da erro, não sei como resolver.
a linha abaixo é o erro.
Uncaught ReferenceError: require is not definedat index.html:7:28
pesquisei e achei um tutoria falando para colocar as seguintes linhas que o problema ia ser resolvido
webPreferences: {
nodeIntegration : true ,
contextIsolation : false,
enableRemoteModule: true
}
mas quando eu faço isso muda de problema ai passa a ser:
Uncaught TypeError: Cannot read properties of undefined (reading ''''''''on'''''''')
at Object.<anonymous> (J:\electron\app.js:4:5)
at Object.<anonymous> (J:\electron\app.js:22:3)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:829:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.i._load (node:electron/js2c/renderer_init:33:356)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
desde já agradeço?
a linha abaixo é o erro.
Uncaught ReferenceError: require is not definedat index.html:7:28
pesquisei e achei um tutoria falando para colocar as seguintes linhas que o problema ia ser resolvido
webPreferences: {
nodeIntegration : true ,
contextIsolation : false,
enableRemoteModule: true
}
mas quando eu faço isso muda de problema ai passa a ser:
Uncaught TypeError: Cannot read properties of undefined (reading ''''''''on'''''''')
at Object.<anonymous> (J:\electron\app.js:4:5)
at Object.<anonymous> (J:\electron\app.js:22:3)
at Module._compile (node:internal/modules/cjs/loader:1116:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:829:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Function.i._load (node:electron/js2c/renderer_init:33:356)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:102:18)
desde já agradeço?
Thiago Andrade
Curtidas 0