Skip to content

Commit b198703

Browse files
committed
[skip ci] docs: add Common Issues page
1 parent ec48369 commit b198703

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
'guide',
3131
'configuration',
3232
'testingAndDebugging',
33+
'commonIssues',
3334
'upgrading'
3435
]
3536
},

docs/guide/commonIssues.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebarDepth: 2
3+
---
4+
5+
# Common Issues
6+
7+
## Blank screen on builds, but works fine on serve
8+
9+
This issue is likely caused when vue-router is operating in `history` mode. Disable history mode like so:
10+
11+
```javascript
12+
// src/router.js or src/router/index.js
13+
// ...
14+
export default new Router({
15+
mode: 'hash' // instead of "mode: 'history'"
16+
// ...
17+
})
18+
// ...
19+
```
20+
21+
## `electron:serve` freezes on `Launching Electron...`
22+
23+
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:
24+
25+
```javascript
26+
if (isDevelopment && !process.env.IS_TEST) {
27+
// Install Vue Devtools
28+
await installVueDevtools()
29+
}
30+
```
31+
32+
## Strict mime-type error when running a built app
33+
34+
This is likely caused because you are missing code in your `public/index.html` file. To add it, simply run `vue invoke electron-builder`. This will re-invoke the generator of VCP Electron Builder. Any missing code will be detected and added automatically. If you would not like to re-invoke the generator, you can paste this code into the top of the `<head>` of your `public/index.html`:
35+
36+
```html
37+
<% if (BASE_URL === './') { %><base href="app://./" /><% } %>
38+
```
39+
40+
## Other issues
41+
42+
Many issues can be solved by re-invoking the generator of Vue CLI Plugin Electron Builder. This allows it to add newer code to your project files. You may need to do this after upgrading the plugin.
43+
44+
```shell
45+
# In the root dir of your project
46+
vue invoke electron-builder
47+
```

0 commit comments

Comments
 (0)