# Error Codes and Messages

The LWC compiler uses parsers such as Babel for JavaScript/TypeScript, a CSS parser for stylesheets, and a template parser for HTML to transform component code. The compiler provides diagnostics related to component structure and syntax. Some of the LWC error codes are wrappers around these parser errors.

LWC returns error codes that use the format LWC0000: Error message. These error codes can either be an error at compile time or a warning at run time. An error is blocking and stops compilation. You can observe these errors in the terminal or CLI output. A warning is a non-blocking diagnostic that doesn't affect compilation. You can typically observe these warnings in the browser's web console.

Error Code Description Severity Level
LWC1001 Represents a generic, unexpected compilation error in the LWC compiler. Error
LWC1002 Represents a warning in module resolution. Warning
LWC1005 Represents an unsupported file extension error. Error
LWC1006 Represents a source type error on transform() or transformSync(). Error
LWC1007 Represents a JavaScript transformer error caused by a syntax error. Error
LWC1009 Represents a CSS transformer error when processing CSS stylesheet files. Error
LWC1011 Represents an import path error. Error
LWC1016 Raised when a Lightning web component tries to assign a value to a getter, which is not permitted. Error
LWC1021 Represents an error for an invalid outputConfig.sourcemap value. Error
LWC1023 Represents an error on the options object. Error
LWC1024 Represents a file content error. Error
LWC1027 Represents an error that's thrown when a string is expected for an ID. Error
LWC1028 Represents a template compiler error when the configuration parameter is not an object. Error
LWC1030 Represents an unrecognized property error on the template compiler. Error
LWC1034 Represents an error for an ambiguous attribute value. Error
LWC1035 Represents an ambiguous attribute value error in the template compiler. Error
LWC1036 Represents an error for a boolean attribute that's incorrectly set. Error
LWC1037 Represents a boolean attribute value error. Error
LWC1038 Represents a computed property access error in a template expression. Error
LWC1039 Represents an iterator directive error. Error
LWC1040 Represents an id value whitespace error. Error
LWC1041 Represents a static id value error. Error
LWC1042 Represents a duplicate id value error. Error
LWC1043 Represents an attribute error on an event handler. Error
LWC1044 Represents an error that's caused by using the for:each or for:item directive without the other. Error
LWC1045 Represents a literal value error on a for:each directive. Error
LWC1046 Represents a value error on the for:index directive. Error
LWC1047 Represents a value error on the for:item directive. Error
LWC1048 Represents an error that occurs when the srcdoc attribute is used on an iframe. Error
LWC1049 Represents an SVG tag error in the <svg> namespace. Error
LWC1050 Represents an invalid MathML tag error. Error
LWC1051 Represents a forbidden template tag error. Error
LWC1052 Represents an unexpected error during template compilation. Error
LWC1054 Represents an error that occurs when the if:* directive is assigned to a string literal or has no value. Error
LWC1055 Represents a case error in HTML attribute names. Error
LWC1056 Represents a naming error on an event handler attribute. Error
LWC1057 Represents a warning when an invalid attribute is used on an HTML element. Warning
LWC1058 Represents an invalid HTML syntax error. Error
LWC1063 Represents an is attribute error. Error
LWC1064 Represents a key attribute error. Error
LWC1065 Represents an invalid key value on an element. Error
LWC1066 Represents an invalid key value for an element. Error
LWC1071 Represents an error for a missing key for an element in an iterator. Error
LWC1072 Represents an error for a missing root template tag. Error
LWC1074 Represents an error for an expression that contains a semicolon. Error
LWC1075 Represents an error for a template that contains more than one root-level node. Error
LWC1076 Represents an error for a slot name is assigned to a dynamic expression. Error
LWC1077 Represents an error for a non-root template tag that doesn't contain a directive. Error
LWC1078 Represents an error for a missing closing tag. Error
LWC1079 Represents an error for a missing root <template> element. Error
LWC1080 Represents an error for an invalid attribute on the root <template> element. Error
LWC1082 Represents an error for an invalid template directive on the <slot> element. Error
LWC1083 Represents a template parsing error when JavaScript expressions in HTML templates have syntax errors, unbalanced brackets, or other parsing issues. Error
LWC1084 Represents an invalid modifier on the if: directive. Error
LWC1085 Represents an invalid value on the lwc:dom directive. Error
LWC1086 Represents an error for a non-empty element with the lwc:dom directive. Error
LWC1087 Represents an error for a custom element with the lwc:dom directive. Error
LWC1088 Represents an error for an lwc:dom directive on any <slot> element. Error
LWC1092 Represents an error for a missing parameter on a wire adapter. Error
LWC1093 Represents an @api and @track combined usage error. Error
LWC1094 Represents an @wire configuration object error. Error
LWC1095 Represents an @api and @wire combined use error. Error
LWC1096 Represents a duplicate @api property error. Error
LWC1097 Represents a wire adapter identifier error. Error
LWC1098 Represents an error when a @wire decorator's first parameter references a local binding. Error
LWC1099 Represents an error on the default value of a boolean public property. Error
LWC1100 Represents an error for invalid decorator usage. Error
LWC1101 Represents an error for a decorator applied to a private class member. Error
LWC1102 Represents an error for a decorator not properly imported from the lwc module. Error
LWC1105 Represents an error for multiple @wire decorators on a single method or property. Error
LWC1106 Represents an @api error when the decorator is used with the computed property syntax. Error
LWC1107 Represents an error for a property name that starts with the "data" prefix. Error
LWC1108 Represents an error for a property name that starts with the "on" prefix. Error
LWC1109 Represents an error for a lowercase attribute name that corresponds to a property that uses a camelCase name. Error
LWC1110 Represents an error for a property name that corresponds to a reserved HTML attribute name. Error
LWC1111 Represents an error for a property name that corresponds to a future reserved attribute name. Error
LWC1112 Represents an error for a duplicate @api declaration on a getter and setter. Error
LWC1113 Represents an error for a @track decorator that is applied to a class method, getter, or setter. Error
LWC1116 Represents an error for an invalid folder name. Error
LWC1121 Represents an error for an invalid import. Error
LWC1122 Represents an error for a <style> element inside an LWC component's HTML template. Error
LWC1123 Represents a warning for an unknown HTML tag. Warning
LWC1124 Represents an error for an attribute name in an LWC template starts with an invalid character. Error
LWC1125 Represents an error for an attribute name in an LWC template that ends with a non-alphanumeric character. Error
LWC1127 Represents an error for using an invalid lwc: directive on an element in an LWC template. Error
LWC1128 Represents an error for using lwc:dynamic without enabling the compiler option. Error
LWC1129 Represents an error for using lwc:dynamic on an element that is not a custom element. Error
LWC1130 Represents an error for passing a string literal to lwc:dynamic. Error
LWC1131 Represents an error when you use computed property syntax to access a wire adapter in the first parameter of the @wire decorator. Error
LWC1132 Represents an error that occurs when the @wire identifier contains nested member expressions. Error
LWC1133 Represents an error for setting lwc:render-mode to an invalid value. Error
LWC1134 Represents an error for invalid attributes on a <slot>element. Error
LWC1135 Represents an error for using lwc:dom="manual" on an element inside a Light DOM template. Error
LWC1136 Represents an error placing for:each and iterator:* on the same element. Error
LWC1137 Represents a warning for defining multiple slots with the same name within the same rendering context. Warning
LWC1138 Represents a warning for placing slots inside iteration blocks. Warning
LWC1139 Represents an error for adding an event listener to a <slot> element inside a Light DOM template. Error
LWC1140 Represents an error for applying lwc:inner-html to a non-native HTML element. Error
LWC1141 Represents an error for using lwc:inner-html on <slot> or <template>. Error
LWC1143 Represents an error for an invalid lwc:inner-html usage on an element. Error
LWC1144 Represents a warning for invalid HTML nesting. Warning
LWC1149 Represents a warning for an invalid key attribute. Warning
LWC1197 Represents an error that occurs when comments are used within template expressions. Error
LWC1199 Represents an error that occurs when a template literal is used with the @wire configuration object. Error
LWC1200 Represents an error that occurs when an invalid expression is used in the @wire configuration object. Error
LWC1201 Represents a warning that occurs when an element with a slot attribute isn't a direct child of a component. Warning
LWC1703 Represents an invalid module identifier. Error
LWC1704 Represents a missing resource value. Error
LWC1709 Represents a syntax error when parsing a file. Error