mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(vue-app): don't normalise route path if it's valid (#9460)
[release]
This commit is contained in:
parent
af491991eb
commit
1ccd15191c
@ -269,12 +269,14 @@ async function createApp(ssrContext, config = {}) {
|
||||
|
||||
// Wait for async component to be resolved first
|
||||
await new Promise((resolve, reject) => {
|
||||
// Ignore 404s rather than blindly replacing URL in browser
|
||||
if (process.client) {
|
||||
const { route } = router.resolve(app.context.route.fullPath)
|
||||
// Ignore 404s rather than blindly replacing URL
|
||||
if (!route.matched.length && process.client) {
|
||||
if (!route.matched.length) {
|
||||
return resolve()
|
||||
}
|
||||
router.replace(route, resolve, (err) => {
|
||||
}
|
||||
router.replace(app.context.route.fullPath, resolve, (err) => {
|
||||
// https://github.com/vuejs/vue-router/blob/v3.4.3/src/util/errors.js
|
||||
if (!err._isRouter) return reject(err)
|
||||
if (err.type !== 2 /* NavigationFailureType.redirected */) return resolve()
|
||||
|
Loading…
Reference in New Issue
Block a user