Skip to content

require(electron) is not defined #945

@capitanhazel

Description

@capitanhazel

Context

Good morning, i'm having a persistent issue across all electron projects, including test projects. Nothing seems to get this strange issue away. Any help would be greatly appreciated!

Note

There is one additional error:

VS Code console is showing strange errors when opening devtools inside of electron. Bug?

[14312:1030/100255.584:ERROR:CONSOLE(1)] "Request Autofill.setAddresses failed. {"code":-32601,"message":"'Autofill.setAddresses' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)

View the project files

I downloaded the example project via this repo itself

since electron does not come installed with the project, i used the bash commands from README.md

Error

> Uncaught ReferenceError: require is not defined
    at main.js:1

Things i've tried

None working as of now...

  • Uninstalled & reinstalled electron
  • Checked global installations for electron
  • Researched with AI
  • Installed latest version of electron

Version & info

index.html is loading properly, along with preload.js & renderer.js

IDE VSCode
OS Windows 10
Package manage NPM
Node Node.js 20.18.0
Electron 33.0.2
Chromium 130.0.6723.59

Thanks for reading, here, take this 🍪 Virtual cookie.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions