Skip to content

Commit c454b9d

Browse files
committed
fix(compiler-dom): do not throw in production on side effect tags
close #8287 close #8292
1 parent ab9256a commit c454b9d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ export const ignoreSideEffectTags: NodeTransform = (node, context) => {
77
node.tagType === ElementTypes.ELEMENT &&
88
(node.tag === 'script' || node.tag === 'style')
99
) {
10-
context.onError(
11-
createDOMCompilerError(DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG, node.loc)
12-
)
10+
__DEV__ &&
11+
context.onError(
12+
createDOMCompilerError(
13+
DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG,
14+
node.loc
15+
)
16+
)
1317
context.removeNode()
1418
}
1519
}

0 commit comments

Comments
 (0)