fix(compiler-ssr) ensure that ssrHelpers are unique after merge from parent context (#3269)
fix #3268
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user