Skip to content

Commit d94d8d4

Browse files
committed
fix(compiler-sfc): use compilerOptions when re-parsing consumed AST
fixes hydration error for custom elements
1 parent be7eabd commit d94d8d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/compiler-sfc/src/compileTemplate.ts

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ function doCompileTemplate({
219219
// We need to parse a fresh one. Can't just use `source` here since we need
220220
// the AST location info to be relative to the entire SFC.
221221
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
222+
...compilerOptions,
222223
parseMode: 'sfc',
223224
onError: e => errors.push(e),
224225
})

packages/sfc-playground/src/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ const sfcOptions: SFCOptions = {
7070
template: {
7171
isProd: useProdMode.value,
7272
compilerOptions: {
73-
isCustomElement: (tag: string) => tag === 'mjx-container'
74-
}
73+
isCustomElement: (tag: string) => tag === 'mjx-container',
74+
},
7575
},
7676
}
7777

0 commit comments

Comments
 (0)