Skip to content

Commit b668430

Browse files
sapphi-redhaoqunjiang
authored andcommitted
fix: handle undefined on import.meta.hot.accept
1 parent 0330a3e commit b668430

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ var __component__ = /*#__PURE__*/__normalizer(
118118
output.push(`export const _rerender_only = true`)
119119
}
120120
output.push(
121-
`import.meta.hot.accept(({ default: updated, _rerender_only }) => {`,
121+
`import.meta.hot.accept(mod => {`,
122+
` if (!mod) return`,
123+
` const { default: updated, _rerender_only } = mod`,
122124
` if (_rerender_only) {`,
123125
` __VUE_HMR_RUNTIME__.rerender(${id}, updated)`,
124126
` } else {`,

0 commit comments

Comments
 (0)