fix(compiler-ssr) ensure that ssrHelpers are unique after merge from parent context (#3269)

fix #3268
This commit is contained in:
lidlanca
2021-02-25 18:25:39 -05:00
committed by GitHub
parent 9cd988342c
commit 012dc5a303
2 changed files with 24 additions and 2 deletions

View File

@@ -56,10 +56,11 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
// Finalize helpers.
// We need to separate helpers imported from 'vue' vs. '@vue/server-renderer'
ast.ssrHelpers = [
ast.ssrHelpers = Array.from(new Set([
...ast.helpers.filter(h => h in ssrHelpers),
...context.helpers
]
]))
ast.helpers = ast.helpers.filter(h => !(h in ssrHelpers))
}