max-mapper / max-mapper/menubar
Electron menubar not loading file in Production - but working properly in development
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.8k
- Forks
- 363
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behaviour
The app is supposed to open with the route specified, as it works for other windows with the same configuration.
Actual Behaviour
But the app opens with a white color window, without any route or page showing.
Specifications
- Menubar version: "menubar": "^9.3.0",
- Platform: macOS
- Electron version: 22.0.2
Other information
Hi guys, I am creating an electron application and I am using the menubar package for electron to create a menubar app.
This is the code I am using to load the menubar route, but once I package the app and open it, the window is not showing the route, it is showing a white screen.
I used the same configuration for creating other windows, and it works properly, only for the menubar it does not properly.
If anyone can let me know what is the error and how I could fix it, it would be really helpful.
const devServerURL = createURLRoute("http://localhost:3000", "menubar");
const fileRoute = createFileRoute(
path.join(__dirname, "../", "index.html"),
"menubar"
);
menubarWindow = menubar({
index: !app.isPackaged ? devServerURL : fileRoute,
preloadWindow: true,
browserWindow: {
width: 550,
height: 675,
show: true,
resizable: false,
icon: path.join(__dirname, "Minder-Logo.png"),
webPreferences: {
nodeIntegration: false, // Default is false
contextIsolation: true, // Default is true
preload: path.join(__dirname, "preload.js"), // Use of preload.jsc
backgroundThrottling: false,
devTools: true,
// preload: path.join(__dirname, 'preload-alt.js') // Use of preload-alt.js
},
},
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied menubar initialization, especially the packaged fileRoute value and the index option, and reproduce the white window in a packaged macOS build using Electron 22.0.2 and menubar 9.3.0. Done means the production menubar window loads its intended route instead of a blank page, while the development route continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100