Skip to content

Commit

Permalink
fix(compiler-sfc): use compilerOptions when re-parsing consumed AST
Browse files Browse the repository at this point in the history
fixes hydration error for custom elements
  • Loading branch information
yyx990803 committed Jan 2, 2024
1 parent be7eabd commit 8498fcb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/compiler-sfc/src/compileTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function doCompileTemplate({
// We need to parse a fresh one. Can't just use `source` here since we need
// the AST location info to be relative to the entire SFC.
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
...compilerOptions,
parseMode: 'sfc',
onError: e => errors.push(e),
})
Expand Down

0 comments on commit 8498fcb

Please sign in to comment.