max-mapper / menubar

➖ high level way to create menubar desktop applications with electron
BSD 2-Clause "Simplified" License
6.64k stars 363 forks source link

Cant find window.require with reactjs #455

Open pacosta613 opened 8 months ago

pacosta613 commented 8 months ago

Description

I am experiencing an issue in my Electron application that uses Menubar. I am trying to create a function and pass it to the ReactJS side of the app, but I encounter an error related to window.require. This issue prevents me from achieving the desired functionality.

Steps to Reproduce the Problem

  1. ...
  2. ...
  3. ...

Expected Behaviour

I expected to be able to create a function and pass it to the ReactJS side of my Electron app without encountering errors related to window.require. The function should work as intended.

Actual Behaviour

The issue occurs when I attempt to use window.require in my Electron app. It results in an "Uncaught TypeError" or another error, preventing me from creating the desired function and passing it to the ReactJS side.

Specifications

Other information

[Include any additional information or context that might be helpful in diagnosing the issue. This could include code snippets, error messages, or any specific configurations you have set up.]

linonetwo commented 2 months ago

Read https://www.electronjs.org/docs/latest/tutorial/sandbox#preload-scripts