Electron - Typeerror var.on is not a Function

Asked

Viewed 84 times

0

Following standard primary structure models offered by Electron documentation (https://electronjs.org/docs/tutorial/quick-start), found errors according to the development of an application.

Showing the necessary information, the message that appeared was: App threw an error During load Typeerror: app.on is not a Function A Javascript error occurred in the main process Uncaught Exception: Typeerror: app.on is not a Function + location in the code you had app.on from

1 answer

0

I found the solution more in the sixth sense of programmer than on the internet. In the documentation, the first line of code of the main.js file, which is linked in package.json : "main" : "main.js", the module is imported to a constant: const {app, Browserwindow} = require('Electron') my code started running after switching to a variable: var { app, Browserwindow} = require('Electron')

I hope I helped :) gave me a good headache. If you know of any vulnerability this exchange brings, please comment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.