Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue router does not work in tauri #2020

Closed
ikey4u opened this issue Jun 20, 2021 · 5 comments
Closed

vue router does not work in tauri #2020

ikey4u opened this issue Jun 20, 2021 · 5 comments

Comments

@ikey4u
Copy link

ikey4u commented Jun 20, 2021

Describe the bug
When using vue router in tauri, it works in yarn tauri:serve mode but not work in built production generated by yarn tauri:build.

To Reproduce

I created a simple and dirty demo here https://github.com/ikey4u/tauri-vue to reproduce the problem

Expected behavior
The built binary generated by yarn tauri:build works as it does in yarn tauri:serve

Screenshots
When clicking vue router in built production, it shows as below
image

Platform and Versions (please complete the following information):

OS: Arch
Node: v16.3.0
NPM: 7.15.1
Yarn: 1.22.10
Rustc: 1.53.0

@Laegel
Copy link
Member

Laegel commented Jun 20, 2021

Hey @ikey4u , thanks for the issue!
I see you're using the history mode that has some known problems with Tauri (I think the history API requires a polyfill), try to switch to the default hash mode.

@lucasfernog
Copy link
Member

The wry team fixed the old history mode but now we need a fix for the custom protocol asset loading. For now the hash mode fixes it.

@ikey4u
Copy link
Author

ikey4u commented Jun 20, 2021

@lucasfernog @Laegel I have changed the mode to hash mode, but it still does not work in built production, see the demo repo.

@lucasfernog
Copy link
Member

I'm checking it right now.

@vanminhquangtri
Copy link

change to hash mode not work for vue 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants