From 20a9051c70f340cc60a52ac7994a39b116767195 Mon Sep 17 00:00:00 2001 From: Zhou xiao Date: Wed, 28 Feb 2024 09:46:35 +0800 Subject: [PATCH] fix(sandbox): sandbox exec script error (#655) --- packages/browser-vm/src/dynamicNode/processor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/browser-vm/src/dynamicNode/processor.ts b/packages/browser-vm/src/dynamicNode/processor.ts index d9f975e1e..e73395e53 100644 --- a/packages/browser-vm/src/dynamicNode/processor.ts +++ b/packages/browser-vm/src/dynamicNode/processor.ts @@ -331,7 +331,10 @@ export class DynamicNodeProcessor { } // Add dynamic script node by loader - if (this.is('script')) { + if ( + this.is('script') && + this.el?.getAttribute('type') !== 'application/json' + ) { parentNode = this.findParentNodeInApp(context, 'body'); convertedNode = this.addDynamicScriptNode(); }