You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just tried adding electron-router-dom to a project using electron-vite but ran into a roadblock when trying to refactor the code that calls loadURL/loadFile to use createElectronRouter.
The code in question is written like so, which seems to be effectively what electron-vite's HMR guide suggests.
I examined createElectronRouter to see if there's some way I could make it happy, but it appears this cannot be refactored to ELECTRON_RENDERER_URL without some something extra.
const devServerUrl = `http://localhost:${props.port ?? port}`; is hardcoded, so there's no easy way to pass in ELECTRON_RENDERER_URL. This would be simple if devServerUrl were an option.
const URLRoute = createURLRoute(devServerUrl, windowId, { also hardcodes the assumption that loadURL points to the root path. Which won't work if that is not the case. I know electron-router-dom is supposed to be taking care of routing but in this case the multi-page pattern is used because the other html document is a special case like a status window that doesn't fit into being part of the router.
The text was updated successfully, but these errors were encountered:
I just tried adding electron-router-dom to a project using electron-vite but ran into a roadblock when trying to refactor the code that calls loadURL/loadFile to use createElectronRouter.
The code in question is written like so, which seems to be effectively what electron-vite's HMR guide suggests.
I examined createElectronRouter to see if there's some way I could make it happy, but it appears this cannot be refactored to ELECTRON_RENDERER_URL without some something extra.
const devServerUrl = `http://localhost:${props.port ?? port}`;
is hardcoded, so there's no easy way to pass in ELECTRON_RENDERER_URL. This would be simple if devServerUrl were an option.const URLRoute = createURLRoute(devServerUrl, windowId, {
also hardcodes the assumption that loadURL points to the root path. Which won't work if that is not the case. I know electron-router-dom is supposed to be taking care of routing but in this case the multi-page pattern is used because the other html document is a special case like a status window that doesn't fit into being part of the router.The text was updated successfully, but these errors were encountered: