Add troubleshooting for Not Found error (#1586)

Issues with Vite's optimizer
This commit is contained in:
Antonio
2022-07-18 18:20:14 +10:00
committed by GitHub
parent f46e825d24
commit 463f5b3cb7
@@ -73,4 +73,30 @@ Source: https://github.com/wailsapp/wails/issues/1233
Sometimes the generated Typescript doesn''t have the correct types. To mitigate this,
it is possible to specify what types should be generated using the `ts_type` struct tag. For
more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types).
more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types).
## Page Not found
When creating multi-page applications (multiple `.html` files), they are not automatically added to `frontend/dist` by Vite, resulting in a `Not Found` error. This is an issue with Vite and not Wails. To manually include files, create a file at `myproject/frontend/vite.config.js` and define rollUp options. An example is provided below:
```
// vite.config.js
import { resolve } from 'path'
import { defineConfig } from 'vite'
export default defineConfig({
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
login: resolve(__dirname, 'src/login.html'),
font: resolve(__dirname, 'src/assets/fonts/nunito-v16-latin-regular.woff2'),
}
}
}
})
```
For more details read the Vite documentation here: https://vitejs.dev/guide/build.html#multi-page-app
Source: https://github.com/wailsapp/wails/issues/1582