Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
This topic describes only module-specific error codes. For details about universal error codes, see Universal Error Codes.
Error Message
'@Watch' cannot be used with 'xxx'. Apply it only to parameters that correspond to existing methods.
Description
This error code is reported when the callback function for the @Watch decorator is not defined.
Possible Causes
The variable decorated with @Watch is defined in the struct, but the corresponding callback function is missing.
Solution
Define a callback function with the same name in the struct to handle the watched variable.
Error Message
'@BuilderParam' property can only initialized by '@Builder' function or '@LocalBuilder' method in struct.
Description
This error code is reported when @BuilderParam decorated variables are initialized using methods other than those decorated with @Builder or @LocalBuilder.
Possible Causes
The @BuilderParam decorated variable is being initialized using a regular function or variable of another type.
Solution
Define functions decorated with @LocalBuilder or @Builder and use them to initialize variables decorated with @BuilderParam.
Error Message
The property 'xxx' cannot have multiple state management decorators.
Description
This error code is reported when a variable is decorated with multiple state management decorators.
Possible Causes
The same variable is decorated with multiple state management decorators.
Solution
Use only one appropriate state management decorator for the variable.
Error Message
The 'xxx' property 'yyy' must be specified a default value.
Description
This error code is reported when variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, or @Provide are not initialized.
Possible Causes
Variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, or @Provide are not initialized.
Solution
Initialize variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, and @Provide.
Error Message
The 'xxx' property cannot be specified a default value.
Description
This error code is reported when initialization is performed on variables decorated with decorators such as @Consume, @Link, and @ObjectLink.
Possible Causes
Initialization is performed when defining variables decorated with decorators such as @Consume, @Link, and @ObjectLink.
Solution
Do not initialize variables decorated with @Consume, @Link, and @ObjectLink. Refer to the correct value assignment rules for decorators.
Error Message
The property 'xxx' must specify a type.
Description
This error code is reported when the type is not specified for a variable decorated with a decorator.
Possible Causes
The type is not specified for a variable decorated with a decorator.
Solution
Specify the type for the variable decorated with the decorator.
Error Message
'@ObjectLink' cannot be used with this type. Apply it only to classes decorated by '@Observed' or initialized using the return value of 'makeV1Observed'.
Description
This error code is reported when the type of a variable decorated with @ObjectLink is not a class or union type decorated with @Observed defined in an .ets file.
Possible Causes
The variable decorated with @ObjectLink is initialized using a class that is not decorated with @Observed or another incompatible type.
Solution
Ensure that class instances decorated with @Observed are used with @ObjectLink.
Error Message
The 'xxx' property 'yyy' cannot be a 'zzz' object.
Description
This error code is reported when a variable decorated with @State or other state decorators is of type CustomDialogController.
Possible Causes
A state variable decorator is used on a variable of type CustomDialogController.
Solution
Do not use state variable decorators on variables of type CustomDialogController.
Error Message
The decorator 'xxx' cannot have the same name as the built-in style attribute 'yyy'.
Description
This error code is reported when a custom decorator has the same name as a built-in property.
Possible Causes
The custom decorator name conflicts with a built-in property name.
Solution
Rename the custom decorator to avoid conflicts with built-in property names.
Error Message
Regular variable 'xxx' can not be decorated with '@Watch'.
Description
This error code is reported when a regular variable is decorated with @Watch.
Possible Causes
The @Watch decorator is used on a regular variable.
Solution
Use @Watch only on state variables decorated with appropriate state variable decorators, such as @State.
Error Message
'@Watch' cannot be used with 'xxx'. Apply it only to 'string' parameters.
Description
This error code is reported when the parameter of the @Watch decorator is not a string.
Possible Causes
A non-string value is used as the parameter for the @Watch decorator.
Solution
Ensure that the parameter of the @Watch decorator is a string.
Error Message
The inner decorator 'xxx' cannot be used together with custom decorator.
Description
This error code is reported when built-in component decorators such as @State are used together with custom decorators.
Possible Causes
A custom decorator is applied to a variable that already has a built-in component decorator, such as @State.
Solution
Avoid using both state variable decorators (such as @State) and custom decorators on the same variable.
Error Message
The 'xxx' component can only be nested in the 'yyy' parent component.
Description
This error code is reported when a component's parent is not the specified parent component.
Possible Causes
The parent component of a component (for example, Blank) is not within the allowed range of parent components.
Solution
Modify the parent component or add an intermediate component based on the error description.
Error Message
The Button component with a label parameter can not have any child.
Description
This error code is reported when a Button component with a label contains child components.
Possible Causes
The Button component includes both a label and child components, which is not allowed.
Solution
Remove either the label content or the child component content (including the braces).
Error Message
'.stateStyles' doesn't conform to standard.
Description
This error code is reported when the stateStyles property does not comply with the syntax.
Possible Causes
The stateStyles property is incorrectly specified or does not conform to the required syntax.
Solution
Ensure that different states in stateStyles are correctly specified.
Error Message
'xxx' does not meet UI component syntax.
Description
This error code is reported when a statement does not comply with the UI component syntax.
Possible Causes
The code does not follow the basic UI component syntax.
Solution
Modify the syntax according to the correct UI component syntax.
Error Message
Then statement cannot be null in if statement.
Description
This error code is reported when the if statement is missing a then clause.
Possible Causes
The then statement in the if syntax is empty.
Solution
Add a valid then clause after the if statement.
Error Message
Condition expression cannot be null in if statement.
Description
This error code is reported when the if statement is missing a condition.
Possible Causes
The judgment condition of the if statement is empty.
Solution
Add a valid condition to the if statement.
Error Message
In the trailing lambda case, 'xxx' must have one and only one property decorated with '@BuilderParam', and its '@BuilderParam' expects no parameter.
Description
This error code is reported when multiple variables decorated with @BuilderParam are defined in the trailing closure scenario, or a variable decorated with @BuilderParam contains parameters.
Possible Causes
In the trailing closure scenario, there can be only one variable decorated with @BuilderParam (excluding parameters).
Solution
Remove unnecessary @BuilderParam decorators and retain only one @BuilderParam decorator without parameters.
Error Message
Only UI component syntax can be written here.
Description
This error code is reported when content other than UI syntax is used.
Possible Causes
Non-UI syntax is used.
Solution
Modify the syntax according to the correct UI component syntax.
Error Message
In an '@Entry' decorated component, the 'build' method can have only one root node, which must be a container component.
Description
This error code is reported when multiple root containers are defined in the build() method.
Possible Causes
Multiple root containers are defined in the build() method.
Solution
Remove redundant root containers to ensure that the build() method has only one root container.
Error Message
The struct 'xxx' must have at least and at most one 'build' method.
Description
This error code is reported when multiple build() methods are defined in the struct component, or the build() method is missing.
Possible Causes
Multiple build() methods are defined in the struct, or the build() method is missing.
Solution
Define only one build() method in the struct.
Error Message
The '@CustomDialog' decorated custom component must contain a property of the CustomDialogController type.
Description
This error code is reported when a custom component decorated with @CustomDialog lacks a member property of the CustomDialogController type.
Possible Causes
The custom component decorated with @CustomDialog does not have a member property of the CustomDialogController type.
Solution
Add a member property of the CustomDialogController type to the custom component decorated with @CustomDialog.
Error Message
Structs are not allowed to inherit from classes or implement interfaces.
Description
This error code is reported when a struct is defined as a subclass or implementation of another class or API.
Possible Causes
The struct extends another class or implements another API.
Solution
Do not use structs to extend other classes or implement other APIs.
Error Message
Static methods in custom components cannot be decorated by '@LocalBuilder'.
Description
This error code is reported when the @LocalBuilder decorator is used on static methods in custom components.
Possible Causes
The @LocalBuilder decorator is used on static methods.
Solution
Remove the static keyword.
Error Message
'@Styles' decorated functions and methods cannot have arguments.
Description
This error code is reported when parameters are included in functions decorated with @Styles.
Possible Causes
Parameters are included in functions decorated with @Styles.
Solution
Remove the parameters from the @Styles decorator.
Error Message
The 'build' method can not have arguments.
Description
This error code is reported when parameters are included in the build() method.
Possible Causes
Parameters are included in the build() method.
Solution
Remove the parameters from the build() method.
Error Message
The static variable of struct cannot be used together with built-in decorators.
Description
This error code is reported when a built-in decorator is used to decorate a static variable in the struct.
Possible Causes
A built-in decorator is used to decorate a static variable in the struct.
Solution
Do not use built-in decorators to decorate static variables in structs.
Error Message
Property 'xxx' cannot initialize using '$' to create a reference to a variable.
Description
This error code is reported when $ is used incorrectly to decorate a variable. $ can only be used on child component attributes decorated with @Link.
Possible Causes
The $ symbol is used to decorate a property member that is decorated with @Prop or other property members not decorated with @Link in a child component.
Solution
Use the @Link decorator to decorate the corresponding variable in the child component, or remove $.
Error Message
The 'xxx' property 'yyy' cannot be assigned to the 'zzz' property 'nnn'.
Description
This error code is reported when the value assignment between parent and child components is incorrect.
Possible Causes
A regular variable is used to initialize a member variable decorated with @Link in a child component.
Solution
Do not use regular variables to initialize member variables decorated with @Link in child components.
Error Message
The property 'xxx' in the custom component 'yyy' is missing (mandatory to specify).
Description
This error code is reported when variables decorated with @Link are not initialized from the parent component.
Possible Causes
The member variable decorated with @Link in the child component is not initialized when the parent component calls the child component.
Solution
Initialize variables decorated with @Link from the parent component.
Error Message
The property 'xxx' in the custom component 'yyy' cannot be initialized here (forbidden to specify).
Description
This error code is reported when variables decorated with @StorageProp, @StorageLink, @Consume, or other decorators are initialized when a parent component calls a child component.
Possible Causes
Member variables decorated with @StorageProp, @StorageLink, and @Consume are initialized when the parent component calls the child component.
Solution
Correctly use variables decorated with the @StorageProp, @StorageLink, or @Consume decorator. For details, see the reference documentation of these decorators.
Error Message
When the two-way binding syntax is used, the initial value of property 'xxx' must be a variable.
Description
This error code is reported when non-variables are used for parent-child transfer using !! with a V2 component.
Possible Causes
Functions, constants, or literals are used for parent-child transfer using !! with a V2 component.
Solution
When using !! with a V2 component for parent-child transfer, make sure only variables are used.
Error Message
When the two-way binding syntax is used, the variable 'xxx' must be decorated with '@Param', and the '@Event' variable 'yyy' must be defined in the 'zzz'.
Description
This error code is reported when @Param is not used together with @Event when !! is used with a V2 component.
Possible Causes
When a V2 component is used, the child component variable is not decorated with @Param or the @Event decorated callback method is not defined.
Solution
Use @Param to decorate child component variables and define the callback method decorated with @Event in the V2 scenario.
Error Message
The optional character can not be used in the initial value of property 'xxx'.
Description
This error code is reported when optional symbols are used to transfer @Param decorated variables defined by child components in the V2 scenario.
Possible Causes
In the V2 scenario, an optional symbol is used for initializing an @Param decorated variable in the child component.
Solution
Avoid using optional symbols when initializing variables decorated with @Param in the V2 scenario.
Error Message
'@Required' decorated 'xxx' must be initialized through the component constructor.
Description
This error code is reported when the initialization of the @Prop and @BuilderParam decorated variables is incorrect.
Possible Causes
The @Require decorator is used with @Prop and @BuilderParam to decorate child component variables, but these variables fail to be initialized when the parent component calls the child component.
Solution
Make sure variables decorated with @Require, @Prop, or @BuilderParam are initialized when the parent component calls the child component.
Error Message
A V2 component cannot be used with any member property decorated by '@Link' in a V1 component.
Description
This error code is reported when a V2 component is used together with the @Link decorator of a V1 component.
Possible Causes
V1 components containing the @Link decorator are used within V2 components.
Solution
Avoid using V1 components with the @Link decorator in V2 components.
Error Message
Property 'xxx' in the '@ComponentV2' component 'yyy' is not allowed to be assigned values here.
Description
This error code is reported when a property decorated with a V2 decorator is assigned to a V1 component.
Possible Causes
The V1 component called is assigned with a property decorated with a V2 decorator.
Solution
Do not assign values of properties decorated with V2 decorators to V1 components.
Error Message
The 'xxx' property 'yyy' in the custom component 'zzz' cannot be initialized here (forbidden to specify).
Description
This error code is reported when variables decorated with specific decorators are initialized during parent-child component calls.
Possible Causes
A variable decorated with a specific decorator in a child component is not correctly initialized when called in the parent component.
Solution
Follow the usage guidelines of the specific decorators.
Error Message
In a struct decorated with '@ComponentV2', '@Require' can only be used with '@Param'.
Description
This error code is reported when the @Require decorator is used with a decorator other than @Param in the V2 scenario.
Possible Causes
The @Require decorator is used with a decorator other than @Param in the V2 scenario.
Solution
Use @Require together with @Param.
Error Message
When a variable decorated with '@Once', it must also be decorated with '@Param'.
Description
This error code is reported when the @Once decorator is used without the @Param decorator in the V2 scenario.
Possible Causes
The variable decorated with @Once is not decorated with @Param in the V2 scenario.
Solution
Use @Once together with @Param.
Error Message
When a variable decorated with '@Param' is not assigned a default value, it must also be decorated with '@Require'.
Description
This error code is reported when a variable decorated with @Param in a V2 component is not assigned a default value and is not decorated with @Require.
Possible Causes
In the V2 scenario, the @Param decorator is used to decorate variables that are not assigned default values or decorated with the @Require decorator.
Solution
Assign a default value to the variable decorated with @Param or decorate it with @Require.
Error Message
'@BuilderParam' property can only be initialized by '@Builder' function.
Description
This error code is reported when @BuilderParam decorated variables are initialized using methods other than those decorated with @Builder.
Possible Causes
Other types of variables or regular functions are used to initialize variables decorated with @BuilderParam.
Solution
Change the initial value of @BuilderParam to a function decorated with @Builder.
Error Message
The property 'xxx' must specify a type.
Description
This error code is reported when the member property type of a state variable fails verification.
Possible Causes
The type of the state variable is not declared.
Solution
Declare the type for the state variable. The type must meet the verification requirements.
Error Message
'@Entry' doesn't support {} parameter in card.
Description
This error code is reported when @Entry in the service widget does not support the specified input parameter.
Possible Causes
An invalid parameter is passed to @Entry in the service widget.
Solution
Rectify the issue based on the error message.
Error Message
'xxx' should have one and only one parameter.
Description
This error code is reported when decorators such as @Extend do not have exactly one parameter.
Possible Causes
When using decorators such as @Extend, no parameter is provided or multiple parameters are provided.
Solution
Make sure decorators such as @Extend have exactly one parameter.
Error Message
Unknown resource name 'xxx'.
Description
This error code is reported when the resource name fails verification.
Possible Causes
The provided resource name is incorrect.
Solution
Make sure the resource name is correct.
Error Message
Unknown resource type 'xxx'.
Description
This error code is reported when the resource type fails verification.
Possible Causes
The provided resource type is incorrect.
Solution
Make sure the resource type is correct.
Error Message
Unknown resource source 'xxx'.
Description
This error code is reported when the resource source fails verification.
Possible Causes
The provided resource source is incorrect.
Solution
Make sure the resource source is correct.
Error Message
Invalid resource file parameter. Enter a value in the format of 'xxx.yyy.zzz'.
Description
This error code is reported when the resource is incorrectly referenced.
Possible Causes
The format used to reference resources is incorrect.
Solution
Make sure the format used to reference resources is correct.
Error Message
No such 'xxx' resource in current module.
Description
This error code is reported when the $rawfile() references a resource that does not exist.
Possible Causes
The provided resource does not exist.
Solution
Make sure the resource name and path used match those specified using $rawfile.
Error Message
The wrapBuilder's parameter should be a '@Builder' function.
Description
This error code is reported when the parameter of wrapBuilder is not a global function decorated with @Builder.
Possible Causes
The parameter of wrapBuilder is not an @Builder decorated function.
Solution
Change the parameter of wrapBuilder to a global function decorated with @Builder.
Error Message
'@Styles' decorated functions and methods cannot have arguments.
Description
This error code is reported when the method decorated with the @Styles decorator contains parameters.
Possible Causes
The method decorated with the @Styles decorator contains parameters.
Solution
Remove the parameters from the @Styles decorated method.
Error Message
The function can not be decorated by '@Extend' and '@AnimatedExtend' at the same time.
Description
This error code is reported when both @AnimatedExtend and @Extend decorators are used to decorate the same API.
Possible Causes
Both the @AnimatedExtend and @Extend decorators are used to decorate the same API.
Solution
Remove either the @Extend or @AnimatedExtend decorator.
Error Message
'xxx' can not decorate the method.
Description
This error code is reported when invalid decorators such as @State are used to decorate methods.
Possible Causes
Property decorators such as @State are used to decorate methods.
Solution
Do not use property decorators such as @State to decorate methods.
Error Message
The component 'xxx' can only have the child component 'yyy'.
Description
This error code is reported when unsupported child components are used in components such as ContainerSpan.
Possible Causes
A component such as ContainerSpan is used incorrectly with a child component outside the supported range.
Solution
Change the child component to one within the specified range.
Error Message
The 'xxx' component can have only one child component.
Description
This error code is reported when components such as Button that allows only a single child component contains multiple child components.
Possible Causes
Multiple child components are defined in a component that allows only a single child component.
Solution
Make sure the component in question has only one child component.
Error Message
When the component 'xxx' set 'yyy' as 'zzz', it can only have a single child component.
Description
This error code is reported when multiple child components are defined for a specific component attribute that allows only a single child component.
Possible Causes
Multiple child components are defined for a specific component attribute that allows only a single child component.
Solution
Delete redundant child components of the specific component. Retain a maximum of one child component.
Error Message
The component 'xxx' can't have any child.
Description
This error code is reported when components such as Image contain braces (child components).
Possible Causes
Child components are defined for components that do not allow child components, such as Image.
Solution
Delete the child components.
Error Message
When the component 'xxx' set 'yyy' as 'zzz', it can't have any child.
Description
This error code is reported when child components are defined for the target component attribute that does not allow child components.
Possible Causes
Child components are defined for the target component attribute that does not allow child components.
Solution
Delete the child components from the target component.
Error Message
Use the 'xxx' decorator only in the global scope.
Description
This error code is reported when decorators such as @Extend are used to decorate a member property method of a class or struct.
Possible Causes
A decorator such as @Extend is used in a class or struct.
Solution
Follow the usage guidelines of decorators such as @Extend and use them to decorate global functions.
Error Message
The 'xxx' decorator can only be used with 'struct'.
Description
This error code is reported when a struct decorator is used to decorate non-structs.
Possible Causes
Struct decorators such as @Component and @ComponentV2 are used to decorate non-structs, such as functions.
Solution
Use the correct decorator based on the error message.
Error Message
The 'xxx' decorator can only be used in a 'struct' decorated with '@ComponentV2'.
Description
This error code is reported when a V2 member decorator is used in a struct not decorated with @ComponentV2.
Possible Causes
The V2 member decorator is used in a struct decorated with @Component.
Solution
Apply the V2 member decorator according to the instructions provided in the error message.
Error Message
The 'xxx' decorator can only be used in a 'struct' decorated with '@Component'.
Description
This error code is reported when the member decorator of V1 is used in a struct not decorated with @Component.
Possible Causes
The V1 member decorator is used in a struct decorated with @ComponentV2.
Solution
Apply the V1 member decorator according to the instructions provided in the error message.
Error Message
A class decorated by '@Observed' cannot inherit from a class decorated by '@ObservedV2'.
Description
This error code is reported when an @Observed decorated class inherits from an @ObservedV2 decorated class.
Possible Causes
An @Observed decorated class inherits from an @ObservedV2 decorated class.
Solution
Inherit from a class decorated with @Observed or change the class decorator to @ObservedV2.
Error Message
A class decorated by '@ObservedV2' cannot inherit from a class decorated by '@Observed'.
Description
This error code is reported when an @ObservedV2 decorated class inherits from an @Observed decorated class.
Possible Causes
An @ObservedV2 decorated class inherits from an @Observed decorated class.
Solution
Inherit from a class decorated with @ObservedV2 or change the class decorator to @Observed.
Error Message
A class can not be decorated by '@Observed' and '@ObservedV2' at the same time.
Description
This error code is reported when a class is decorated with both '@Observed' and '@ObservedV2'.
Possible Causes
Both @Observed and @ObservedV2 are used to decorate the same class.
Solution
Retain only one appropriate class decorator.
Error Message
The 'xxx' can decorate only member variables in a 'class'.
Description
This error code is reported when decorators designed to decorate member variables in a class are used to decorate methods instead.
Possible Causes
You use decorators such as @Type to decorate methods in the class.
Solution
Delete the decorators such as @Type from the method in the class.
Error Message
The 'xxx' decorator can not be used in a 'class' decorated with '@Observed'.
Description
This error code is reported when the decorator used in an @Observed decorated class is not supported.
Possible Causes
The decorator used in an @Observed decorated class is not supported.
Solution
Remove the unsupported decorator.
Error Message
The 'xxx' decorator can not be used in a 'class' decorated with '@Sendable'.
Description
This error code is reported when the decorator such as @Type used in an @Sendable decorated class is not supported.
Possible Causes
The decorator such as @Type used in an @Sendable decorated class is not supported.
Solution
Remove the unsupported decorator such as @Type.
Error Message
The 'xxx' can decorate only member 'yyy' within a 'class' decorated with '@ObservedV2'.
Description
This error code is reported when decorators designed to decorate member methods in an @ObservedV2 decorated class are used to decorate member methods in classes decorated with @Observed.
Possible Causes
Decorators designed to decorate member methods in an @ObservedV2 decorated class are used to decorate member methods in classes decorated with @Observed.
Solution
Use the decorator in question, such as @Monitor, only in @ObservedV2 decorated classes. In @Observed classes, use the @Watch decorator instead.
Error Message
'xxx' cannot be used with classes decorated by '@ObservedV2'. Use the '@Trace' decorator instead.
Description
This error code is reported when a decorator designed for V1 is used with an @ObservedV2 decorated class.
Possible Causes
A decorator designed for V1, such as @Track, is used with an @ObservedV2 decorated class.
Solution
Do not use decorators designed for V1 in @ObservedV2 decorated classes.
Error Message
The 'xxx' decorator can decorate only member variables of a class.
Description
This error code is reported when a decorator designed for use within a class is applied outside of a class.
Possible Causes
A decorator designed for use within a class, such as @Track, is applied outside of a class.
Solution
Make sure the decorators designed for use within a class are applied only within a class.
Error Message
'xxx' can only decorate member property.
Description
This error code is reported when decorators such as @Local, @Param, @Once, @Event, @Provider, @Consume, and @BuilderParam are used to decorate non-member properties in @ComponentV2.
Possible Causes
The @Local, @Param, @Once, @Event, @Provider, @Consume, or @BuilderParam decorator is used to decorate a non-member property in @ComponentV2.
Solution
Use @Local, @Param, @Once, @Event, @Provider, @Consume, and @BuilderParam only to decorate member properties in @ComponentV2.
Error Message
'xxx' can only decorate method.
Description
This error code is reported when method decorators, such as @LocalBuilder and @Monitor, are used to decorate non-methods.
Possible Causes
Method decorators, such as @LocalBuilder and @Monitor, are used to decorate property variables, global functions, or methods in classes.
Solution
Use the method decorators only to decorate methods.
Error Message
'@Computed' can only decorate 'GetAccessor'.
Description
This error code is reported when @Computed is used to decorate a method that is not a getter.
Possible Causes
The @Computed decorator is used to decorate a non-getter method.
Solution
Use @Computed only to decorate getter methods.
Error Message
A function can only be decorated with one of the '@AnimatedExtend', '@Builder', '@Extend', '@Styles', '@Concurrent' and '@Sendable''.
Description
This error code is reported when two different method decorators are defined on the same method.
Possible Causes
Multiple method decorators are defined on the same method.
Solution
Select a single appropriate method decorator to use.
Error Message
Duplicate 'xxx' decorators for method are not allowed.
Description
This error code is reported when the same decorator is applied to the same method multiple times.
Possible Causes
The same decorator is used repeatedly for a method.
Solution
Avoid using the same decorator multiple times on the same method.
Error Message
The member property or method can not be decorated by multiple built-in decorators.
Description
This error code is reported when multiple built-in decorators are used to decorate the same member property or method.
Possible Causes
Multiple built-in decorators are used on the same member property or method.
Solution
Select a single appropriate built-in decorator to use.
Error Message
The type of the 'xxx' property can not be a class decorated with '@ObservedV2'.
Description
This error code is reported when a class decorated with @ObservedV2 is used as the type of a state variable.
Possible Causes
A class decorated with @ObservedV2 is used as the type of a state variable.
Solution
Avoid using classes decorated with @ObservedV2 as the type for state variables.
Error Message
'@Concurrent' can not be used on 'xxx' function declaration.
Description
This error code is reported when @Concurrent is used to decorate a specific function.
Possible Causes
The @Concurrent decorator is used to decorate a specific function.
Solution
Do not use the @Concurrent decorator on specific functions.
Error Message
'@Concurrent' can not be used on method, please use it on function declaration.
Description
This error code is reported when @Concurrent is used to decorate methods.
Possible Causes
The @Concurrent decorator is used to decorate methods.
Solution
Use the @Concurrent decorator only on function declarations, not on methods.
Error Message
The struct 'xxx' cannot have the same name as the built-in component 'xxx'.
Description
This error code is reported when the name of a custom component matches the name of a built-in component.
Possible Causes
The custom component has the same name as a built-in component.
Solution
Rename the custom component to a name that is different from any built-in component names.
Error Message
The struct 'xxx' cannot have the same name as the built-in attribute 'xxx'.
Description
This error code is reported when the name of a custom component matches the name of a built-in component attribute method.
Possible Causes
The custom component has the same name as an attribute method of a built-in component.
Solution
Rename the custom component to a name that is different from any built-in component attribute method names.
Error Message
The struct 'xxx' can not be decorated with '@ComponentV2' and '@Component', '@Reusable', '@CustomDialog' at the same time.
Description
This error code is reported when a struct is decorated with multiple incompatible decorators such as @ComponentV2, @Component, @Reusable, and @CustomDialog.
Possible Causes
Multiple decorators that are not compatible with each other are used on the same struct.
Solution
Avoid using incompatible decorators on the same struct. Use only one appropriate decorator for the struct.
Error Message
Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'xxx'.
Description
This error code is reported when a child component is not decorated with @Component, @ComponentV2, or @CustomDialog.
Possible Causes
The child component is not decorated with @Component, @ComponentV2, or @CustomDialog.
Solution
Make sure the child component is decorated with @Component, @ComponentV2, or @CustomDialog.
Error Message
A page configured in 'main_pages.json' or 'build-profile.json5' must have one and only one '@Entry' decorator.
Description
This error code is reported when the @Entry decorator is missing or incorrectly used on the home page.
Possible Causes
The home page is not decorated with the @Entry decorator.
Solution
Make sure the home page has exactly one @Entry decorator.
Error Message
A page can't contain more than one '@Entry' decorator.
Description
This error code is reported when multiple @Entry decorators are used on a single page.
Possible Causes
Multiple @Entry decorators are used on a single page.
Solution
Remove unnecessary @Entry decorators, making sure only one @Entry decorator is used on a page.
Error Message
A page can contain at most 10 '@Preview' decorators.
Description
This error code is reported when more than 10 @Preview decorators are used on a single page.
Possible Causes
More than 10 @Preview decorators are used on the same page.
Solution
Remove unnecessary @Preview decorators, making sure a maximum of 10 @Preview decorators are used on a page.
Error Message
A struct must have a name.
Description
This error code is reported when a struct is not named.
Possible Causes
No name is provided for the struct.
Solution
Define a name for the struct.
Error Message
Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'xxx'.
Description
This error code is reported when a child component is not decorated with @Component, @ComponentV2, or @CustomDialog and is called by the parent component.
Possible Causes
The child component is not decorated with @Component, @ComponentV2, or @CustomDialog.
Solution
Make sure the child component is decorated with @Component, @ComponentV2, or @CustomDialog before calling it.
Error Message
The member property or method can not be decorated by multiple decorators.
Description
This error code is reported when multiple decorators are used on the same member property or method.
Possible Causes
Multiple decorators are used on the same member property or method.
Solution
Remove redundant decorators and retain only one appropriate decorator.
Error Message
The module name 'xxx' can not be the same as the inner component name.
Description
This error code is reported when the name of a custom component matches the name of a built-in component.
Possible Causes
The custom component has the same name as a built-in component.
Solution
Change the name of the custom component to a name that is different from any built-in component names.
Error Message
UI component 'xxx' cannot be used in this place.
Description
This error code is reported when the ArkUI built-in component is used outside the allowed context, such as outside the @Builder or build() method.
Possible Causes
The built-in component is used outside the @Builder or build() method, which does not meet the usage restrictions.
Solution
Use the built-in component within the @Builder method, build() method, or page transition method.
Error Message
The struct name cannot contain reserved tag name: 'xxx'.
Description
This error code is reported when the name of a custom component matches the name of an existing component.
Possible Causes
The custom component has the same name as an existing component.
Solution
Change the name of the custom component to a valid component name that is different from the existing component name.
Error Message
Should not add return type to the function that is decorated by Styles.
Description
This error code is reported when functions decorated with @Styles return function types.
Possible Causes
The return value of the function decorated with @Styles is of the function type.
Solution
Do not declare the return value of a function decorated with @Styles as a function type.
Error Message
A struct declaration without the 'default' modifier must have a name.
Description
This error code is reported when a struct declaration without the default modifier is not named.
Possible Causes
The struct is declared without the default modifier and is not named.
Solution
Name the struct correctly.
Error Message
Should not add return type to the function that is decorated by Extend.
Description
This error code is reported when functions decorated with @Extend return function types.
Possible Causes
The return value of the function decorated with @Extend is of the function type.
Solution
Do not declare the return value of a function decorated with @Extend as a function type.
Error Message
A property decorated by 'xxx' cannot be used with two-bind syntax.
Description
This error code is reported when the @Computed decorator is incorrectly used with two-way binding syntax.
Possible Causes
The @Computed decorator and two-way binding syntax are used together.
Solution
Do not use the @Computed decorator and two-way binding syntax together.
Error Message
A property decorated by 'xxx' cannot define a set method.
Description
This error code is reported when the @Computed decorator is used on a setter method.
Possible Causes
The setter method is decorated using the @Computed decorator.
Solution
Use the @Computed decorator only on a getter method.
Error Message
When the two-way binding syntax is used, do not assign a value to 'xxx' variable 'yyy' because the framework generates the default assignment.
Description
This error code is reported when a value is assigned to the variable in an @Event decorated method while two-way binding syntax is used.
Possible Causes
Two-way binding syntax is used and a value is passed to the @Event method.
Solution
When using two-way binding syntax, do not pass values to the @Event method. The ArkUI framework will handle the default assignment.
Error Message
The '@Reusable' and '@ReusableV2' decorators cannot be applied simultaneously.
Description
This error code is reported when @Reusable and @ReusableV2 are used together.
Possible Causes
Both @Reusable and @ReusableV2 are used to decorate a component.
Solution
Do not use @Reusable and @ReusableV2 together. Choose one appropriate decorator.
Error Message
'@ReusableV2' is only applicable to custom components decorated by '@ComponentV2'.
Description
This error code is reported when @ReusableV2 is used to decorate custom components that are not decorated with @ComponentV2.
Possible Causes
The @ReusableV2 decorator is used to decorate components that are not decorated with @ComponentV2.
Solution
Use @ReusableV2 only with custom components decorated with @ComponentV2.
Error Message
A custom component decorated with '@Component' cannot contain child components decorated with '@ReusableV2'.
Description
This error code is reported when components decorated with @Component contain child components decorated with @ReusableV2.
Possible Causes
A component decorated with @Component calls a child component decorated with @ReusableV2.
Solution
Do not call components decorated with @ReusableV2 within components decorated with @Component.
Error Message
A custom component decorated with '@Reusable' cannot contain any child components decorated with '@ReusableV2'.
Description
This error code is reported when components decorated with @Reusable contain child components decorated with @ReusableV2.
Possible Causes
A component decorated with @Reusable calls a child component decorated with @ReusableV2.
Solution
Do not call components decorated with @ReusableV2 within components decorated with @Reusable.
Error Message
A custom component decorated with '@ReusableV2' cannot contain child components decorated with '@Reusable'.
Description
This error code is reported when components decorated with @ReusableV2 contain child components decorated with @Reusable.
Possible Causes
A component decorated with @ReusableV2 calls a child component decorated with @Reusable.
Solution
Do not call components decorated with @Reusable within components decorated with @ReusableV2.
Error Message
Property 'xxx' must be initialized through the component constructor.
Description
This error code is reported when the variable decorated with @Require is not initialized during parent component construction.
Possible Causes
The variable decorated with @Require is not initialized during parent component construction.
Solution
Initialize variables decorated with @Require when constructing the parent component.
Error Message
The template attribute of the Repeat component cannot contain any custom component decorated with '@ReusableV2'.
Description
This error code is reported when Repeat.template contains custom components decorated with @ReusableV2.
Possible Causes
The template property of Repeat contains a custom component decorated with @ReusableV2.
Solution
Remove the component decorated with @ReusableV2 from the template property.
Error Message
The reuse attribute is only applicable to custom components decorated with both '@ComponentV2' and '@ReusableV2'.
Description
This error code is reported when the reuse attribute is incorrectly applied to components that are not properly decorated for reuse functionality.
Possible Causes
The reuse attribute is not used with custom components that are decorated with both @ComponentV2 and @ReusableV2.
Solution
Use the reuse attribute only for custom components decorated with both @ComponentV2 and @ReusableV2.
Error Message
The reuseId attribute is not applicable to custom components decorated with both '@ComponentV2' and '@ReusableV2'.
Description
This error code is reported when reuseId is used for custom components decorated with @ComponentV2 and @ReusableV2.
Possible Causes
reuseId is used for custom components decorated with @ComponentV2 and @ReusableV2.
Solution
Use the reuseId attribute in the correct scenario.
Error Message
The V1 decorator 'xxx' cannot be applied to a Function-type variable 'yyy'.
Description
This error code is reported at runtime when the ArkUI state management V1 decorator is used for variables of the Function or () => void type. Since API version 23, this issue is intercepted in the compilation phase to avoid potential runtime exceptions. The ArkUI state management V1 decorators include @State, @Prop, @Link, @Provide, @Consume, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, @ObjectLink.
Possible Causes
The V1 decorator is used for a variable of the Function or () => void type.
Solution
Delete the V1 decorator used for the variable of the Function or () => void type based on the error description.
Error Message
The '@Extend' function cannot have the same name as the built-in style attribute 'xxx' of the component 'yyy'.
Description
This error code is reported when the name of the @Extend decorated function is the same as the name of a built-in attribute of the corresponding component.
Possible Causes
You name the @Extend decorated function of the component the same as a built-in attribute of the component.
Solution
Modify the name of the @Extend decorated function to ensure that it is different from the name of any built-in attribute of the component.
Error Message
The '@Env' property cannot be specified a default value.
Description
This error code is reported when variables decorated with @Env are assigned initial values.
Possible Causes
You assign initial values to variables decorated with @Env.
Solution
Avoid assigning initial values to variables decorated with @Env.
Error Message
The '@Env' decorator can only be used in structs decorated by '@Component' or '@ComponentV2'.
Description
This error code is reported when the @Env decorator is used in structs other than those decorated with @Component and @ComponentV2.
Possible Causes
You use the @Env decorator in a class or globally.
Solution
Ensure that the @Env decorator is used only in structs decorated with @Component and @ComponentV2.
Error Message
The '@Env' decorator can only decorate 'WindowSizeLayoutBreakpointInfo', 'SizeInVP', 'Size', 'UIEnvWindowAvoidAreaInfoPX', 'UIEnvWindowAvoidAreaInfoVP' classes or their child classes.
Description
This error code is reported when the @Env decorator is used to decorate instances of classes other than a specific class or its child classes.
Possible Causes
You use the @Env decorator to decorate instances of classes other than the specified type and its child classes.
Solution
Use the @Env decorator to decorate only instances of the specific class and its child classes.
Error Message
Within structs decorated with '@ComponentV2', '@Env' can only initialize variables decorated with '@Param'.
Description
This error code is reported in the following scenario: When a struct decorated with @ComponentV2 is constructed, variables decorated with @Env initialize state variables decorated with decorators other than @Param.
Possible Causes
When constructing a struct decorated with @ComponentV2, you use variables decorated with @Env to initialize state variables decorated with decorators other than @Param.
Solution
Do not use variables decorated with @Env to initialize state variables decorated with V2 decorators other than @Param.
Error Message
Within structs decorated with '@Component', '@Env' can only initialize regular (non-decorated) variables.
Description
This error code is reported in the following scenario: When a struct decorated with @Component is constructed, variables decorated with @Env initialize variables other than common variables.
Possible Causes
When constructing a struct decorated with @Component, you use variables decorated with @Env to initialize state variables.
Solution
When constructing a struct decorated with @Component, do not use variables decorated with @Env to initialize state variables.
Error Message
The type of the parent component's state variable initializing the '@Link' variable 'xxx' must match the '@Link' variable's declared type.
Description
This error code is reported when the data source used by the parent component to initialize the state variable decorated with @Link in the child component is not a state variable of the corresponding type.
Possible Causes
You use the properties of a state variable or a state variable of an incorrect type to initialize the state variables decorated with @Link.
Solution
Use the state variable of the corresponding type to initialize the state variables decorated with @Link.
Error Message
Only constant expressions are supported as parameters in '@SyncMonitor'. Variables are not allowed.
Description
This error code is reported when the following condition is not met: The @SyncMonitor decorator accepts only constant strings as parameters and does not allow variables to be passed.
Possible Causes
You pass a variable, constant, or function's return value as the parameter of the @SyncMonitor decorator.
Solution
To ensure the certainty of the input value, pass a constant string as the parameter of the @SyncMonitor decorator.
Error Message
'@SyncMonitor' cannot observe non-existent variables or non-state variables, except in wildcard-based monitoring scenarios.
Description
This error code is reported when the following condition is not met: @SyncMonitor cannot observe non-existent variables or non-state variables (except in wildcard mode).
Possible Causes
You pass a non-existent variable or a non-state variable in the parameters of the @SyncMonitor decorator.
Solution
Pass an existing state variable in the parameters of the @SyncMonitor decorator.
Error Message
In wildcard-based monitoring scenarios with 'xxx', the .* pattern must be placed at the end of the string.
Description
This error code is reported when symbol '.*' is not placed at the end of the string in the wildcard-based observation scenario of @SyncMonitor and @Monitor.
Possible Causes
You place symbol '.*' in an incorrect position in the wildcard-based observation scenario of @SyncMonitor or @Monitor.
Solution
Place symbol '.*' at the end of the string.
Error Message
Invalid parameter. State variables decorated with '@Env' of type 'xxx' can only accept 'yyy'.
Description
This error code is reported when the strict key-value matching between parameters of the @Env decorator and decorated variable types is not met.
Possible Causes
You do not pass values based on the strict key-value matching between parameters of the @Env decorator and decorated variable types.
Solution
Pass the correct decorator parameters based on the matching.
Error Message
In a struct decorated with '@Component', the function decorated with '@ComponentReuse' has the following input parameter: params : Record<string, Object | null | undefined>.
Description
This error code is reported when the @ComponentReuse decorated function does not define specific parameter types in the struct decorated with @Component.
Possible Causes
No parameter is defined or the parameter type is incorrect in the function decorated with @ComponentReuse in the struct decorated with @Component.
Solution
Define the corresponding parameter type in the function decorated with @ComponentReuse.
Error Message
Methods decorated with '@ComponentReuse' in '@ComponentV2' cannot have input parameters.
Description
This error code is reported when the @ComponentReuse decorated function has input parameters in the struct decorated with @ComponentV2.
Possible Causes
You define parameters in the function decorated with @ComponentReuse in the struct decorated with @ComponentV2.
Solution
Delete the defined parameters from the function decorated with @ComponentReuse.
Error Message
Methods decorated with 'xxx' cannot have input parameters.
Description
This error code is reported when the method decorated with a specific lifecycle decorator (for example, @ComponentRecycle) has input parameters.
Possible Causes
You define parameters in the method decorated with a specific lifecycle decorator.
Solution
Delete the defined parameters from the function decorated with a specific lifecycle decorator.
Error Message
The value of 'enableWildcard' must be a Boolean keyword.
Description
This error code is reported when the value passed to enableWildcard is not a Boolean keyword.
Possible Causes
When @Monitor uses wildcards, you pass a non-Boolean keyword value to the enableWildcard attribute.
Solution
Use the true or false keyword for the enableWildcard attribute.
Error Message
'xxx' is not a '@Reusable' or '@ReusableV2' component and cannot be added to poolAccepts.
Description
This error code is reported when the poolAccepts attribute cannot accept a non-reuse component after global reuse is enabled.
Possible Causes
After global reuse is enabled, a non-reusable component is passed to the poolAccepts attribute.
Solution
When global reuse is used, only reused components can be passed to poolAccepts.
Error Message
'xxx' cannot list itself in poolAccepts. The pool is not yet ready when 'xxx' is being constructed.
Description
This error code is reported when a component itself cannot be passed in the poolAccepts attribute after global reuse is enabled because the reuse pool is not ready during component build.
Possible Causes
After global reuse is enabled, the component itself is passed in the poolAccepts attribute.
Solution
When global reuse is used, do not pass the component itself in poolAccepts.
Error Message
'xxx' must provide both reusePool and poolAccepts. Neither can be omitted when using the global reuse pool.
Description
This error code is reported when reusePool and poolAccepts are not both passed at the same time for the global reuse pool.
Possible Causes
Only one of the reusePool and poolAccepts attributes is passed when you use the global reuse pool.
Solution
Pass both reusePool and poolAccepts when using the global reuse pool.
Error Message
PoolAccepts cannot be an empty array. Provide at least one '@Reusable' or '@ReusableV2' component.
Description
This error code is reported when poolAccepts is an empty array for the global reuse pool. (At least one reusable component must be passed.)
Possible Causes
You pass an empty array to the poolAccepts attribute for the global reuse pool.
Solution
Pass at least one reusable component in poolAccepts for the global reuse pool.
Error Message
ReusePool must be either 'shared' or 'perInstance'. The value 'xxx' is not valid.
Description
This error code is reported when an invalid value (such as 'xxx') is passed in reusePool for the global reuse pool.
Possible Causes
You pass an invalid value other than 'shared' or 'perInstance' in the reusePool attribute for the global reuse pool.
Solution
Pass 'shared' or 'perInstance' in the reusePool attribute for the global reuse pool.
Error Message
ReusePool can only accept string literal.
Description
This error code is reported when the reusePool attribute of the global reuse pool is not a string.
Possible Causes
You pass a variable, constant, or function's return value in the reusePool attribute of the global reuse pool.
Solution
Ensure that the reusePool attribute of the global reuse pool is a string.
Error Message
The type of the property decorated with 'xxx' must be consistent with the generic type of the key.
Description
This error code is reported when the variable type decorated with @CustomEnv or @Env Decorator is inconsistent with the generic type of the decorator parameter.
Possible Causes
The variable type decorated with the @CustomEnv or @Env Decorator is inconsistent with the generic type of the decorator parameter.
Solution
Ensure that the variable type is consistent with the generic type of the decorator parameter.
Error Message
Invalid key for '@CustomEnv', '@CustomEnv' key must be global const and created from CustomEnvKey.create<T>().
Description
This error code is reported when the parameter in the @CustomEnv decorator does not comply with a specific syntax format (constants initialized by CustomEnvKey.create<T>()).
Possible Causes
The parameter passed in the @CustomEnv decorator does not comply with a specific syntax format.
Solution
Modify the parameter passed in the @CustomEnv decorator based on the requirements of constants initialized by CustomEnvKey.create<T>().