]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-sfc): use correct compiler when re-parsing in ssr mode
authorEvan You <yyx990803@gmail.com>
Mon, 27 Nov 2023 07:06:07 +0000 (15:06 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 27 Nov 2023 07:06:07 +0000 (15:06 +0800)
packages/compiler-sfc/src/compileTemplate.ts

index c34342a7a0c1557ab023891e7b0c5b2b4c940067..1afdc74bf22a0e3aff40695365ee3bedbf5182bb 100644 (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)
     })