404 in [email protected] production build
Seems since upgrading to the latest nuxt, nuxt-electron, and electron v30 after using electron-builder to create an installer and installing it, the 404 issue arises. This never happened before.
See: https://github.com/nuxt/nuxt/issues/15629#issuecomment-2110813784
------------------------------
- Operating System: Windows_NT
- Node Version: v22.1.0
- Nuxt Version: 3.11.2
- CLI Version: 3.11.1
- Nitro Version: 2.8.1
- Package Manager: [email protected]
- Builder: -
- User Config: ssr, router, css, modules, electron, ionic, vite, nitro
- Runtime Modules: @nuxtjs/[email protected], [email protected]
- Build Modules: -
------------------------------
After adding the following to the nuxt config the problem goes away:
export default defineNuxtConfig({
router: {
options: {
hashMode: true,
},
},
}
Seems nuxt-electron set's this here https://github.com/caoxiemeihao/nuxt-electron/blob/main/src/index.ts#L177
However since upgrading it seems in a production build that is doesn't work anymore.
After adding the following to the nuxt config the problem goes away:
export default defineNuxtConfig({ router: { options: { hashMode: true, }, }, }
Thank you for your way. I spent a full 5 hours before that. Now it works.