Skip to content

Commit d2b87d5

Browse files
meihao550posva
andauthored
feat: prevent race condition dev-only error (#2789)
* fix(RouterView): guard against null instance when assigning __vrv_devtools * Apply suggestion from @posva --------- Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
1 parent b75d5a8 commit d2b87d5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/router/src/RouterView.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export const RouterViewImpl = /*#__PURE__*/ defineComponent({
196196

197197
internalInstances.forEach(instance => {
198198
// @ts-expect-error
199-
instance.__vrv_devtools = info
199+
// to prevent possible race condition in SSR
200+
// https://github.com/vuejs/router/pull/2789
201+
if (instance) instance.__vrv_devtools = info
200202
})
201203
}
202204

0 commit comments

Comments
 (0)