Skip to content

Commit 5c75d29

Browse files
authored
refactor(core): Improve tree-shakable RuntimeError error for INVALID_FIELD_DIRECTIVE_HOST
Improves the tree-shakable runtime error handling for `INVALID_FIELD_DIRECTIVE_HOST`.
1 parent 50674f8 commit 5c75d29

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/core/src/render3/instructions/control.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ function initializeControlFirstCreatePass<T>(tView: TView, tNode: TNode, lView:
181181
return;
182182
}
183183

184-
const host = describeElement(tView, tNode);
185184
throw new RuntimeError(
186185
RuntimeErrorCode.INVALID_FIELD_DIRECTIVE_HOST,
187-
`${host} is an invalid [field] directive host. The host must be a native form control ` +
188-
`(such as <input>', '<select>', or '<textarea>') or a custom form control with a 'value' or ` +
189-
`'checked' model.`,
186+
ngDevMode &&
187+
`${describeElement(tView, tNode)} is an invalid [field] directive host. The host must be a native form control ` +
188+
`(such as <input>', '<select>', or '<textarea>') or a custom form control with a 'value' or ` +
189+
`'checked' model.`,
190190
);
191191
}
192192

0 commit comments

Comments
 (0)