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

Electron Shows an error when import the preload.js part of the module #195

Closed
Muhammad-Taif-Khan opened this issue Sep 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Muhammad-Taif-Khan
Copy link

Muhammad-Taif-Khan commented Sep 19, 2022

Error

Showing the following error when importing the preload part of the module.
Error: module not found: custom-electron-titlebar at preloadRequire

Expected behavior

There preload.js part of the 'custom-electron-titlebar' should work without causing any err.

CODE[preload.js]

const {Titlebar,Color} = require('custom-electron-titlebar');

window.addEventListener('DOMContentLoaded', () => {
    new Titlebar({
            backgroundColor: Color.fromHex("#388e3c"),
            itemBackgroundColor: Color.fromHex("#121212"),
            svgColor: Color.WHITE,
            //menu: null // = do not automatically use Menu.applicationMenu
          
    });
});

Desktop

  • OS: WINDOWS 10
  • Electron version "^20.1.4"
  • Node Version "16"

@AlexTorresSk is this is because the new 20 update of electronjs?
As there any work around to solve this problem?

@leytonoday
Copy link

@Muhammad-Taif-Khan Do you have a solution to this issue yet? Seems as if the code in the preload is making my electron app crash

@leytonoday
Copy link

leytonoday commented Sep 28, 2022 via email

@AlexTorresDev AlexTorresDev added the bug Something isn't working label Sep 28, 2022
@AlexTorresDev
Copy link
Owner

Fix on #194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants