diff --git a/packages/compiler-sfc/src/compileTemplate.ts b/packages/compiler-sfc/src/compileTemplate.ts index 019aa5b0d65..5b7fe268366 100644 --- a/packages/compiler-sfc/src/compileTemplate.ts +++ b/packages/compiler-sfc/src/compileTemplate.ts @@ -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), })