Skip to content

Commit 5a64f46

Browse files
committed
fix(document-driven): avoid calling middleware on hash change
1 parent bcf241a commit 5a64f46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/plugins/documentDriven.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,11 @@ export default defineNuxtPlugin((nuxt) => {
249249
}
250250

251251
// Route middleware
252-
addRouteMiddleware(async (to) => {
252+
addRouteMiddleware(async (to, from) => {
253253
// TODO: Remove this (https://github.com/nuxt/framework/pull/5274)
254254
if (to.path.includes('favicon.ico')) { return }
255+
// Avoid calling on hash change
256+
if (process.client && to.path === from.path) { return }
255257

256258
const redirect = await refresh(to, false)
257259

0 commit comments

Comments
 (0)