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

router-next does not like base with trailing slash #164

Closed
ishitatsuyuki opened this issue Apr 12, 2020 · 0 comments
Closed

router-next does not like base with trailing slash #164

ishitatsuyuki opened this issue Apr 12, 2020 · 0 comments

Comments

@ishitatsuyuki
Copy link

A reasonable setup for vue-cli with vue-next (and router) would look like this:

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

Here BASE_URL defaults to /.

In the older router there exists logic to strip the trailing slash:

https://github.com/vuejs/vue-router/blob/fc42d9cf8e1d381b885c9af37003198dce6f1161/src/history/base.js#L213-L231

This is probably gone in router-next. Therefore,

createWebHistory("/")

causes the router to attempt to pushState(.., "//"), resulting in SecurityError: The operation is insecure.

vue-router 4.0.0-alpha.5

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

No branches or pull requests

1 participant