This topic describes only module-specific error codes. For details about universal error codes, see Universal Error Codes.
Error Message
The target is not a custom component instance or V2 class instance.
Description
This error code is reported when the target object parameter for addMonitor or clearMonitor is invalid.
Possible Causes
The target object does not meet the following requirements:
Solution
Ensure that the target object for addMonitor or clearMonitor is valid. For details, see addMonitor and clearMonitor APIs: Dynamically Adding or Removing Listeners.
Error Message
The path is invalid.
Description
This error code is reported when the path parameter for addMonitor or clearMonitor is invalid.
Possible Causes
The path is neither a string nor an array.
Solution
Ensure that the path for addMonitor or clearMonitor is valid. For details, see addMonitor and clearMonitor APIs: Dynamically Adding and Removing Listeners.
Error Message
addMonitor/clearMonitor failed because the monitorFunc is illegal, monitorFunc must be function or but cannot be an anonymous function.
Description
This error code is reported when the callback parameter for addMonitor or clearMonitor is invalid.
Possible Causes
The callback is not of the function type or is of an anonymous function type.
Solution
Ensure that the callback for addMonitor or clearMonitor is valid. For details, see addMonitor and clearMonitor APIs: Dynamically Adding and Removing Listeners.
Error Message
The function is not allowed to be called in @Computed.
Description
This error code is reported when the applySync, flushUpdates, or flushUIUpdates API cannot be called in a getter method decorated with @Computed.
Possible Causes
The applySync, flushUpdates, or flushUIUpdates API is called in a getter method decorated with @Computed. The getter method decorated with @Computed is used to calculate derived values. Calling these APIs in the method will trigger additional state updates and break the evaluation logic of computed properties. For details, see the constraints of applySync/flushUpdates/flushUIUpdates APIs.
Solution
Ensure that the applySync, flushUpdates, and flushUIUpdates APIs are not called within getter methods decorated with @Computed.
Error Message
The function is not allowed to be called in @Monitor.
Description
This error code is reported when the flushUpdates or flushUIUpdates API cannot be called in the callback method decorated with @Monitor.
Possible Causes
The flushUpdates or flushUIUpdates API is called in an @Monitor callback method. The callback method decorated with @Monitor is triggered when the status changes. Calling these APIs in the callback method will cause repeated status updates, which may lead to cyclic updates. For details, see the constraints of applySync/flushUpdates/flushUIUpdates APIs.
Solution
Ensure that the flushUpdates and flushUIUpdates APIs are not called in @Monitor callback methods.
Error Message
Not supported type! The type should have function constructor signature.
Description
This error code is reported in the following scenario: When connect of AppStorageV2 or connect and globalConnect of PersistenceV2 are used, the type parameter is invalid.
Possible Causes
When connect of AppStorageV2 or connect and globalConnect of PersistenceV2 are used, the type parameter is not of the TypeConstructorWithArgs<T> type.
Solution
Ensure that the type parameter passed by connect or globalConnect is of the TypeConstructorWithArgs<T> type. For details about the supported types, see the PersistenceV2 usage constraints and AppStorageV2 usage constraints.
Error Message
The default creator should be function when first connect.
Description
This error code is reported in the following scenario: When connect of AppStorageV2 or connect and globalConnect of PersistenceV2 are used for the first time, the default data constructor specified by defaultCreator is not StorageDefaultCreator<T>.
Possible Causes
defaultCreator is not of the StorageDefaultCreator<T> type.
Solution
Ensure that defaultCreator passed by connect or globalConnect is of the StorageDefaultCreator<T> type. The following uses globalConnect as an example. For details, see globalConnect.
Error Message
ERROR, Duplicate key used when connect
Description
This error code is reported when connect and globalConnect use the same key.
Possible Causes
connect and globalConnect use the same key.
Solution
You are advised not to use connect and globalConnect together. If you need to use them together, ensure that they do not use the same key. For details, see the PersistenceV2 usage constraints.
Error Message
AreaMode Value Error! value range can only in EL1-EL5
Description
This error code is reported when the encryption level set for globalConnect of PersistenceV2 to store data is not within the range of EL1 to EL5.
Possible Causes
The value of the areaMode attribute of ConnectOptions of globalConnect is not within the range of EL1 to EL5.
Solution
Set the encryption level to EL1 to EL5. For details, see Using globalConnect to Store Data.
Error Message
The type of target mismatches the type of source.
Description
This error code is reported when connect of AppStorageV2 or connect and globalConnect of PersistenceV2 are used.
Possible Causes
Solution
Error Message
Miss @Type.
Description
This error code is reported in the following scenario: The @Type decorator is missing when globalConnect of PersistenceV2 is used.
Possible Causes
When the globalConnect API is used to persist data, the @Type decorator is missing in the data type. This error code is reported in the log and no runtime exception is thrown.
Solution
Ensure that the @Type decorator is used to decorate the class name when the globalConnect API is used to persist complex types of data.
Error Message
@Builder: Invalid attempt to set(write to) parameter error!
Description
This error code is reported when the input parameters are modified in the function decorated by @Builder.
Possible Causes
The input parameters are modified in the function decorated by @Builder. For details, see the @Builder constraints.
Solution
Do not modify the input parameters in the function decorated by @Builder. You can use MutableBinding instead. For details, see Changing the Input Parameters in the @Builder Decorated Function.
Error Message
Illegal usage of not @Track'ed property on UI!
Description
This error code is reported in the following scenario: If a property in a class is decorated by @Track, do not use the class's properties that are not decorated by @Track in the UI.
Possible Causes
Bind the properties that are not decorated by @Track in the class decorated by @Track to the UI. For details, see the @Track constraints.
Solution
Add the @Track decorator to the property displayed in the error message. For details, see Improperly Using Non-@Track Decorated Properties Causes Errors.
Error Message
@Consume missing @Provide property with name or default value. Fail to resolve @Consume.
Description
This error code is reported in the following scenario: @Consume fails to be initialized because @Consume does not find the matching @Provide data source, and the default value of @Consume is not provided.
Possible Causes
The possible causes why @Consume fails to find @Provide are as follows:
Solution
Error Message
Old toolchain detected. Please upgrade to the latest.
Description
This error code is reported in the following scenario: Since API version 18, @ComponentV2 (child component) can be created in @Reusable (parent component). However, you need to use the SDK of API version 18 or later. Otherwise, a runtime error will occur. Since API version 23, this error code will be returned. For details, see the @ReusableV2 usage constraints.
Possible Causes
Since API version 18, mixed usage of @Reusable (in the parent component) and @ComponentV2 (in the child component) is supported. If you use API version 18 or later, but does not use the SDK of API version 18 or later for compilation, an error is reported during running, indicating that the SDK version is too early.
Solution
Use the SDK of API version 18 or later to compile the application.
Error Message
duplicate @Provide property. Property with this name is provided by one of the ancestor Views already.
Description
This error code is reported when the @Provide decorators with the duplicate key declared exist in the same component, parent component, or ancestor node. For details, see the @Provide constraints.
Possible Causes
The @Provide decorators with the duplicate key declared exist in the same component, parent component, or ancestor node.
Solution
Ensure that the keys of the @Provide decorators are different in the same component, including its parent component and ancestor node. Alternatively, set the allowOverride parameter in ProvideOptions to make the key overridable. For details, see Support for the allowOverride Parameter.
Error Message
Illegal variable value error with decorated variable
Description
This error code is reported when an unsupported type is used when you create a state variable in state management V1.
Possible Causes
An unsupported type is decorated using a V1 state variable decorator (such as @State, @Prop, or @Link).
Solution
Use the type supported by the state variable of state management V1. @State is used as an example. For details, see the @State usage rules.
Error Message
The key is invalid, key must be string or TypeConstructorWithArgs type.
Description
This error code is reported when an invalid key is passed for using the remove API of AppStorageV2 and PersistenceV2 and the save API of PersistenceV2.
Possible Causes
The key is not of the string or TypeConstructorWithArgs<T> type.
Solution
Ensure that the key passed for using the remove API of AppStorageV2 and PersistenceV2 and the save API of PersistenceV2 is of the string or TypeConstructorWithArgs<T> type.