Open
Description
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Forge version
7.7.0
Electron version
35.0.2
Operating system
macOS 15.3.2
Last known working Forge version
No response
Expected behavior
Notifications should work both in development mode and in the packaged application.
Actual behavior
In development mode (electron-forge start), notifications work as expected on macOS.
After packaging the application using electron-forge package, notifications no longer appear.
Removing FusesPlugin from the Forge configuration restores notifications in the packaged app.
Steps to reproduce
Create a minimal Electron Forge project:
npx electron-forge@latest init test-app --template=typescript-webpack
cd test-app
npm install
Add a simple notification in src/main.ts:
const createWindow = () => {
// Function to show a notification
const showNotification = () => {
const notification = new Notification({
title: 'Hello World',
body: ''
});
notification.show();
};
// Import the Notification module
// Show notification after the window is created
setTimeout(() => {
if (Notification.isSupported()) {
showNotification();
}
}, 2000);
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
});
// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
} else {
mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`));
}
// Open the DevTools.
mainWindow.webContents.openDevTools();
};
Run the application in dev mode:
yarn start
Notifications appear correctly.
Package the application:
yarn make
Open the packaged app:
Notifications do not appear.
Remove FusesPlugin from forge.config.ts, repackage, and pack again:
Notifications work again.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels