Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.require is not a function #1

Open
rahmaniali-ir opened this issue Mar 23, 2021 · 1 comment
Open

window.require is not a function #1

rahmaniali-ir opened this issue Mar 23, 2021 · 1 comment

Comments

@rahmaniali-ir
Copy link

Hey. thanks for the youtube tutorial. I've followed your instructions to access the file system through react components. but it doesn't seem to work and I couldn't find any solutions online. I get an error saying "window.require is not a function". I followed the exact footsteps as you did them in the video. but it just doesn't work. I'd appreciate your help 🙏

@pablogarayprosis
Copy link

if your are using electro version > 12 then add contextIsolation: false to webPreferences when Create the browser window in main.js

const win = new BrowserWindow({
  width: 800,
  height: 600,
  webPreferences: {
    nodeIntegration: true,
    enableRemoteModule: true,
    contextIsolation: false
  }
})

then reload your project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants