Skip to content

Commit

Permalink
fix(compiler-sfc): use correct compiler when re-parsing in ssr mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 27, 2023
1 parent 2e65ea4 commit 678378a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function doCompileTemplate({
// input AST has codegenNode - it has already been transformed and cannot
// be reused. 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 = compiler.parse(inAST.source, {
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
parseMode: 'sfc',
onError: e => errors.push(e)
})
Expand Down

0 comments on commit 678378a

Please sign in to comment.