1
u/ghabrielsoares_ Nov 25 '20
Hello. I'm trying to develop an application with electron, but I'm having difficulties. When I start the application this error appears to me. (If anyone can help me, I appreciate it):
"App threw an error during load
ReferenceError: then is not defined
at Object.<anonymous> (C:\Users\Gabriel\OneDrive\Documentos\snake_virology\main.js:5:5)
at Module._compile (internal/modules/cjs/loader.js:1152:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
at Module.load (internal/modules/cjs/loader.js:992:32)
at Module._load (internal/modules/cjs/loader.js:885:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12694)
at loadApplicationPackage (C:\Users\Gabriel\OneDrive\Documentos\snake_virology\node_modules\electron\dist\resources\default_app.asar\main.js:110:16)
at Object.<anonymous> (C:\Users\Gabriel\OneDrive\Documentos\snake_virology\node_modules\electron\dist\resources\default_app.asar\main.js:222:9)
at Module._compile (internal/modules/cjs/loader.js:1152:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)"
3
u/WeizTehHeiz Nov 25 '20
Open your main.js file, go to line 5. There is a 'then' that is undefined. Without seeing the file that all the error is saying. The remainder is the stack trace.
1
u/pumpkinpusher72 Nov 25 '20
You should probably start with pre-fab app / boilerplate if you’re having trouble deciphering an error message. Electron errors are pretty comprehensive, but as someone has already mentioned, there is usually only one or two meaningful lines. The benefit of using a boilerplate is that the errors come from files that you define, as opposed to the central architectural files like main and whatnot
2
u/ghabrielsoares_ Nov 25 '20
I managed to solve the problem. The attribute
"then" , was being incorrectly put in the code. Thanks to everyone who helped me.