Skip to content

Commit

Permalink
refactor($core): catch initial push to avoid warning (vuejs#2629)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored Sep 28, 2020
1 parent 4268c79 commit 795c230
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions packages/@vuepress/core/lib/client/serverEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default context => new Promise((resolve, reject) => {
return reject({ url: fullPath })
}

router.push(url)
router.onReady(() => resolve(app))
// error handled in onReady
router.push(url).catch(() => {})
router.onReady(() => resolve(app), reject)
})
})
2 changes: 1 addition & 1 deletion packages/@vuepress/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"url-loader": "^1.0.1",
"vue": "^2.6.10",
"vue-loader": "^15.7.1",
"vue-router": "^3.1.3",
"vue-router": "^3.4.5",
"vue-server-renderer": "^2.6.10",
"vue-template-compiler": "^2.6.10",
"vuepress-html-webpack-plugin": "^3.2.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13715,10 +13715,10 @@ vue-loader@^15.7.1:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"

vue-router@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
integrity sha512-8iSa4mGNXBjyuSZFCCO4fiKfvzqk+mhL0lnKuGcQtO1eoj8nq3CmbEG8FwK5QqoqwDgsjsf1GDuisDX4cdb/aQ==
vue-router@^3.4.5:
version "3.4.5"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.4.5.tgz#d396ec037b35931bdd1e9b7edd86f9788dc15175"
integrity sha512-ioRY5QyDpXM9TDjOX6hX79gtaMXSVDDzSlbIlyAmbHNteIL81WIVB2e+jbzV23vzxtoV0krdS2XHm+GxFg+Nxg==

vue-server-renderer@^2.6.10:
version "2.6.10"
Expand Down

0 comments on commit 795c230

Please sign in to comment.