Skip to content

Commit 678378a

Browse files
committed
fix(compiler-sfc): use correct compiler when re-parsing in ssr mode
1 parent 2e65ea4 commit 678378a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/compiler-sfc/src/compileTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function doCompileTemplate({
218218
// input AST has codegenNode - it has already been transformed and cannot
219219
// be reused. We need to parse a fresh one. Can't just use `source` here
220220
// since we need the AST location info to be relative to the entire SFC.
221-
const newAST = compiler.parse(inAST.source, {
221+
const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, {
222222
parseMode: 'sfc',
223223
onError: e => errors.push(e)
224224
})

0 commit comments

Comments
 (0)