Error Message
FA mode does not support unit test.
Symptom
The FA model does not support unit tests.
Possible Causes
Unit tests are executed using commands in the FA model project.
Solution
Do not perform unit tests on FA model projects.
Error Message
The XXX plugin was not found when initializing the YYY module
Symptom
The XXX plug-in cannot be found during module initialization.
Possible Causes
The module.type field in the module.json5 file is inconsistent with the system plug-in exported from the hvigorfile.ts file.
Solution
Ensure that the value of module.type in the module.json5 file of the module is the same as the system plug-in exported from the hvigorfile.ts file.
Error Message
The root node is not yet available for build.
Symptom
The root node is not ready for build.
Possible Causes
Solution
Locate the plugin installation path by printing the following information via the hvigorconfig.ts or hvigorfile.ts file:
import { hvigor } from '@ohos/hvigor';
console.log(hvigor.getParameter().getWorkspaceDir()) 

console.log(require.resolve('@ohos/hvigor')); 
Error Message
The hvigorConfig is not yet available for build.
Symptom
hvigorConfig is not ready for build.
Possible Causes
DevEco Studio and Command Line Tools come with the hvigor plugin preinstalled by default, so no additional configuration is required. If there are multiple hvigor plugins in the environment, multiple plugins may be detected during the build process, resulting in an error.
Solution
Locate the plugin installation path by printing the following information via the hvigorconfig.ts or hvigorfile.ts file:
import { hvigor } from '@ohos/hvigor';
console.log(hvigor.getParameter().getWorkspaceDir()) 

console.log(require.resolve('@ohos/hvigor')); 
Error Message
XXX in hvigorfile at XXX.
Symptom
An exception occurs when the internal hook function is called.
Possible Causes
An exception occurs when the hook function in the node is executed.
Solution
Call the API correctly by referring to the extended API document.
Error Message
Invalid exports, no system plugins were found in hvigorfile: XXX.
Symptom
Export failed. No system plug-ins are found in hvigorfile.
Possible Causes
Solution
Example:
export default {
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
} Error Message
Unknown module XXX in the command line.
Symptom
The CLI contains an unknown module XXX.
Possible Causes
The module name in the command is dynamically deleted from the hvigorconfig.ts file.
Solution
Ensure that the module is not deleted from the hvigorconfig.ts file.
Error Message
Unknown module XXX in the command line.
Symptom
The CLI contains an unknown module XXX.
Possible Causes
The module name in the command does not exist in the project-level build-profile.json5 file.
Solution
Ensure that the module is set in the modules field of the project-level build-profile.json5 file.
Error Message
File XXX exports an invalid plugin XXX with invalid order return XXX. Must return a number value.
Symptom
The return value type of the custom plugin is incorrect.
Possible Causes
The plugin exported from the specified file has an incorrect return value type.
Solution
Ensure that the return value of the exported plugin is a number.
Error Message
File XXX exports an invalid plugin XXX whose name XXX duplicate with other plugins. Please rename this plugin.
Symptom
The custom plugin name is duplicated.
Possible Causes
The name of the custom plugin exported from the specified file conflicts with other plugin names.
Solution
Check for duplicate custom Hvigor plugin names and rename the conflicting plugin if necessary.
Error Message
File XXX has no default export.
Symptom
The custom plugin does not have a default export.
Possible Causes
The custom Hvigor plugin does not use export default.
Solution
Add export default to the Hvigor plugin defined in the specified file.
Error Message
File XXX exports an undefined plugin.
Symptom
An undefined plugin is exported.
Possible Causes
An undefined Hvigor plugin is exported from the specified file.
Solution
Ensure that the correct Hvigor plugin is exported.
Error Message
File XXX exports an invalid plugin with type XXX.
Symptom
The custom plugin type is incorrect.
Possible Causes
The plugin exported from the specified file has an incorrect type.
Solution
Check the type of the exported plugin to ensure it is an object.
Error Message
File XXX exports an invalid plugin without a name.
Symptom
A plugin without a name is exported from the specified file.
Possible Causes
The plugin exported from the specified file does not have a name.
Solution
Ensure that the exported plugin has a name.
Error Message
File XXX exports an invalid plugin whose name is not a string.
Symptom
A plugin with a non-string name is exported from the specified file.
Possible Causes
The name of the plugin exported from the specified file is not a string.
Solution
Ensure that the name of the exported plugin is a string.
Error Message
File XXX exports an invalid plugin YYY with unknown order ZZZ.
Symptom
A plugin with an unknown execution order is exported from the specified file.
Possible Causes
The execution order of the plugin exported from the specified file is unknown.
Solution
Ensure that the exported plugin has the correct execution order.
Error Message
File XXX exports an invalid plugin YYY whose hook ZZZ is not a function.
Symptom
A plugin with a non-function hook is exported from the specified file.
Possible Causes
The hook of the plugin exported from the specified file is not a function.
Solution
Ensure that the hook of the exported plugin is correctly defined as a function.
Error Message
The plugin referenced in the hvigorfile does not match moduleType in the module.json5/config.json file.
Symptom
The plugin referenced in hvigorfile is inconsistent with the module type in the module.json5/config.json file.
Possible Causes
The task type (such as hapTasks) registered in hvigorfile is inconsistent with the module type (such as HAR module). For example, the HAP module references harPlugin.
Solution
Ensure that the task type matches the module type.
Error Message
Mismatch with apiType at 'XXX'.
Symptom
The apiType configuration at XXX does not match.
Possible Causes
apiType configured in the module-level hvigorfile.ts file is inconsistent with that in the module-level build-profile.json5 file.
Solution
Set apiType to the same values in module-level hvigorfile.ts file and module-level build-profile.json5 file.
Error Message
Invalid exports, no system plugins were found in hvigorfile. At file: XXX.
Symptom
Export failed. No system plug-ins are found in hvigorfile.
Possible Causes
Solution
Example:
export default {
system: legacyAppTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
} Error Message
Invalid exports, no system plugins were found in hvigorfile.
Symptom
Export failed. No system plug-ins are found in hvigorfile.
Possible Causes
Solution
Example:
export default {
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
} Error Message
Method setProperty validate failed in hvigorfile.ts.
Symptom
The setProperty method in the hvigorfile.ts file fails to be validated.
Possible Causes
The parameters passed to the setProperty method fail schema validation.
Solution
Modify the fields in the hvigorfile.ts file based on the error message.
Error Message
Failed to execute hook 'XXX': YYY.
Symptom
The XXX lifecycle fails to be executed.
Possible Causes
An error is reported when the code in the XXX lifecycle is executed.
Solution
Error Message
Failed to execute function 'XXX' of the custom plugin whose pluginId is 'YYY': ZZZ.
Symptom
The XXX function of the custom plugin YYY fails to be executed.
Possible Causes
An error is reported when the code in the XXX function of the custom plugin YYY is executed.
Solution
Locate the plugin installation path by printing the following information via the hvigorconfig.ts or hvigorfile.ts file:
import { hvigor } from '@ohos/hvigor';
console.log(hvigor.getParameter().getWorkspaceDir()) 

console.log(require.resolve('@ohos/hvigor')); 
Error Message
Failed to execute node hook 'XXX': YYY.
Symptom
The XXX lifecycle fails to be executed.
Possible Causes
An error is reported when the code in the XXX lifecycle is executed.
Solution
Error Message
Failed to load or execute hvigorfile.ts: XXX At file: YYY.
Symptom
Failed to execute the hvigorfile.ts file.
Possible Causes
An error occurred during the execution of the hvigorfile.ts file and its dependent files.
Solution
Locate the plugin installation path by printing the following information via the hvigorconfig.ts or hvigorfile.ts file:
import { hvigor } from '@ohos/hvigor';
console.log(hvigor.getParameter().getWorkspaceDir()) 

console.log(require.resolve('@ohos/hvigor')); 
Error Message
'getAllDependencyInfo()' must be called after dependencies are collected.
Symptom
The dependency information is updated in taskGraphResolved. Therefore, the getAllDependencyInfo API must be called in lifecycle hooks at or after the taskGraphResolved phase.
Possible Causes
The getAllDependencyInfo API is called before the taskGraphResolved phase.
Solution
Call this API in lifecycle hooks at or after the nodesEvaluated phase by referring to getAllDependencyInfo.
Error Message
Failed to load or execute hvigorfile.ts: XXX. At file: YYY.
Symptom
Failed to execute the hvigorfile.ts script.
Possible Causes
Solution
Error Message
'getOhpmDependencyInfoV2()' must be called after dependencies are collected.
Symptom
The dependency information is updated in taskGraphResolved. Therefore, the getOhpmDependencyInfoV2 API must be called in lifecycle hooks at or after the taskGraphResolved phase.
Possible Causes
The getOhpmDependencyInfoV2 API is called before the taskGraphResolved phase.
Solution
Call this API in lifecycle hooks at or after the nodesEvaluated phase by referring to getOhpmDependencyInfoV2.
Error Message
'getOhpmRemoteHspDependencyInfoV2()' must be called after dependencies are collected.
Symptom
The dependency information is updated in taskGraphResolved. Therefore, the getOhpmRemoteHspDependencyInfoV2 API must be called in lifecycle hooks at or after the taskGraphResolved phase.
Possible Causes
The getOhpmRemoteHspDependencyInfoV2 API is called before the taskGraphResolved phase.
Solution
Call this API in lifecycle hooks at or after the nodesEvaluated phase by referring to getOhpmRemoteHspDependencyInfoV2.