Closed TiagoSilvaPereira closed 2 years ago
Same problem here, did you find any solution?
@Muhammad-Taif-Khan no, but I discovered that it is not that hard to add a custom title bar to an electron app, so I decided to do it by myself: https://www.electronjs.org/docs/latest/tutorial/window-customization
The error comes from this line.
Setting the parameter icon
fix the error, but I don't think it should be a mandatory option...
Yep, it should not be a mandatory one.
Working on it
Describe the bug When using the package, it is firing the following error message on preload.ts:
Uncaught TypeError: Cannot read properties of undefined (reading 'toDataURL') at t.default._setupIcon
To Reproduce Steps to reproduce the behavior:
- Create a new electron + typescript project following this template: https://github.com/Deluze/electron-vue-template
- Follow the instructions to setup custom-electron-titlebar
- Add the following declaration to a .d.ts file to enable importing custom-electron-titlebar
declare module "custom-electron-titlebar/main" { import type cetMain from "custom-electron-titlebar/dist/main/main"; export const setupTitlebar: typeof cetMain.setupTitlebar; export const attachTitlebarToWindow: typeof cetMain.attachTitlebarToWindow; }
- See the error in the console
Expected behavior The expected behavior is to show the title bar
Screenshots
Desktop:
- OS: Windows 11
- Electron version: 20.1.0
- Node Version: 16.13
This bug was fixed in the clean code branch. In the next few weeks a beta will be released and in the next month the stable version. 🚀🚀
Describe the bug When using the package, it is firing the following error message on preload.ts:
To Reproduce Steps to reproduce the behavior:
Expected behavior The expected behavior is to show the title bar
Screenshots
Desktop: