vue-cli-plugin-electron-builder icon indicating copy to clipboard operation
vue-cli-plugin-electron-builder copied to clipboard

Initial Route not working in build electron.exe

Open MBurchard opened this issue 2 years ago • 2 comments

Describe the bug The Initial Route is not loaded/shown in the build electron.exe.
I'd like to confirm if this is a bug in this cli or in the electron-builder.

To Reproduce I have setup a very basic project: https://github.com/MBurchard/vue-electron-bug-2022-05-16

  1. An initial Vue 3 project.
  2. vue add electron-builder@alpha
  3. change tsconfig.json, add "useUnknownInCatchVariables": false,
  4. Test the project with npm run electron:serve --> All looks fine
  5. Build the project with npm run electron:build
  6. switch to folder dist_electron\win-unpacked and start the electron.exe --> Initial Route not loaded... Router works when using the links.

Expected behavior The initial Route should be loaded correctly like in the serve mode.

Screenshots grafik

MBurchard avatar May 16 '22 20:05 MBurchard

I faced the same problem and my solution was to use the onMounted hook in Vue.

Example:

onMounted(() => {
this.$router.push('/');
})

Olesko24 avatar May 18 '22 09:05 Olesko24

yes, we also have a workaround in place for our application, but it should work without it and it would be nice if this can be fixed.

MBurchard avatar May 18 '22 09:05 MBurchard

No support to the alpha release.

MatthijsBurgh avatar Feb 07 '23 10:02 MatthijsBurgh