fix(compiler-sfc): use correct compiler when re-parsing in ssr mode

This commit is contained in:
Evan You 2023-11-27 15:06:07 +08:00
parent 2e65ea481f
commit 678378afd5
1 changed files with 1 additions and 1 deletions

View File

@ -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)
})