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
Copy file name to clipboardExpand all lines: docs/guide/commonIssues.md
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,23 @@ sidebarDepth: 2
6
6
7
7
## Blank screen on builds, but works fine on serve
8
8
9
-
This issue is likely caused when vue-router is operating in `history` mode. Disable history mode like so:
9
+
This issue is likely caused when vue-router is operating in `history` mode. To fix this, add a `mounted` hook to the root Vue component:
10
10
11
11
```javascript
12
-
// src/router.js or src/router/index.js
13
-
// ...
14
-
exportdefaultnewRouter({
15
-
mode:'hash'// instead of "mode: 'history'"
16
-
// ...
17
-
})
18
-
// ...
12
+
// src/main.js
13
+
14
+
newVue({
15
+
router,
16
+
render:h=>h(App),
17
+
mounted() {
18
+
// Prevent blank screen in Electron builds
19
+
this.$router.push('/')
20
+
}
21
+
}).$mount('#app')
19
22
```
20
23
24
+
This will fix the Electron build issues, but won't affect web builds.
25
+
21
26
## `electron:serve` freezes on `Launching Electron...`
22
27
23
28
Often this issue is caused when Vue Devtools fails to install. This may happen if Vue Devtools cannot be accessed in your location (eg. China). To fix this, you may have to disable Vue Devtools by removing the following lines from your `src/background.(js|ts)` file:
0 commit comments