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 electron js. #43

Open
ShivamRawat0l opened this issue Jan 23, 2022 · 0 comments
Open

Window.require is not a function electron js. #43

ShivamRawat0l opened this issue Jan 23, 2022 · 0 comments

Comments

@ShivamRawat0l
Copy link

ShivamRawat0l commented Jan 23, 2022

index.es.js:1020 Uncaught TypeError: window.require is not a function
at Module../node_modules/react-electron-titlebar/dist/index.es.js

Getting this error when using the react-electron-titlebar in electron-react-boilerplate.

"electron": "^16.0.5",
"electron-builder": "22.13.1",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.1.1",
"electron-rebuild": "^3.2.5",

react-electron-titlebar is of latest version.

Few moments later.

I had preload script in the webPreferences after removing that the error is not

Cannot read properties of undefined (reading 'getCurrentWindow')

So I am not able to require('electron') in the app with window.require and if I require directly without window it says

Cannot read properties of undefined (reading 'exsistSync') for fs as it is not able to require the fs module.

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

1 participant