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

Multi-page multi-route: When directly refresh in the sub-routing page, "Uncaught SyntaxError: Unexpected token <" error happened #10859

Closed
kluslulu opened this issue Nov 23, 2019 · 2 comments

Comments

@kluslulu
Copy link

@kluslulu kluslulu commented Nov 23, 2019

Version

2.6.10

Reproduction link

https://github.com/kluslulu/multi-page-app
image
image

Steps to reproduce

I created a multi-page app by vue-cli3.
when I in a sub-routing page,if I refresh this page by command R directly,it will be showing a white page

What is expected?

I hope to refresh success in a sub-routing page

What is actually happening?

Showing a white page and some error in console:
Uncaught SyntaxError: Unexpected token '<'
index.js:1 Uncaught SyntaxError: Unexpected token '<'

@shadowings-zy

This comment has been minimized.

Copy link

@shadowings-zy shadowings-zy commented Nov 23, 2019

I think your project will show a white page after refresh because your vue-router is using history mode in your project.
You can fix it by using hash mode or configure your server to redirect the correct route.

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Nov 23, 2019

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.


https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

@posva posva closed this Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.