tauri-apps / tauri-apps/plugins-workspace
`tauri_plugin_localhost` doesn't work in dev mode
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
When running `npm run tauri dev` on linux and using the `tauri_plugin_localhost` example code, nothing loads in the localhost-served window. However, this works correctly in a fully built binary.
This appears to be because, unlike when the app is fully built, the path `/` does not resolve to `/index.html`.
Adding
```
let path = if path == "/" {
"/index.html".to_string()
} else {
path
};
```
after https://github.com/tauri-apps/plugins-workspace/blob/fe23a5e01399a6ad61426bf8a94a6bb97227cf88/plugins/localhost/src/lib.rs#L90 appears to serve files that have been already built with `vite build`, but I am not sure how to forward the files from vite's dev server.
Contributor guide
Assessment
This issue has not been assessed yet.