Skip to content

Commit

Permalink
fix(compiler-dom): do not throw in production on side effect tags
Browse files Browse the repository at this point in the history
close #8287
close #8292
  • Loading branch information
yyx990803 committed May 12, 2023
1 parent ab9256a commit c454b9d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ export const ignoreSideEffectTags: NodeTransform = (node, context) => {
node.tagType === ElementTypes.ELEMENT &&
(node.tag === 'script' || node.tag === 'style')
) {
context.onError(
createDOMCompilerError(DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG, node.loc)
)
__DEV__ &&
context.onError(
createDOMCompilerError(
DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG,
node.loc
)
)
context.removeNode()

This comment has been minimized.

Copy link
@nickcarterney

nickcarterney May 15, 2023

Should not remove Nodes in production mode!

}
}

0 comments on commit c454b9d

Please sign in to comment.