arkts_error_fixes

Provides solutions for common ArkTS compilation errors and type mismatches. Invoke when encountering ArkTS errors during HarmonyOS development.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "arkts_error_fixes" with this command: npx skills add open-deveco/arkts-error-solution-skills/open-deveco-arkts-error-solution-skills-arkts-error-fixes

ArkTS Error Fixes

This skill provides solutions for common ArkTS compilation errors and type mismatches encountered during HarmonyOS development.

Error Categories

CategoryDescription
Notification API Type ErrorsContentType type incompatibility
Window API Type ErrorsType inference issues with window.getLastWindow
AppStorage Type ErrorsType inference errors with AppStorage.get()
Object Spread Type ErrorsType inference issues with object spread
@StorageLink Default Value ErrorsMissing default values for @StorageLink properties
Object Literal Interface ErrorsObject literals without explicit interfaces
Object Literal Type ErrorsUsing object literal types in return type annotations
Function Return Type ErrorsLimited return type inference
Arrow Function Conversion ErrorsUsing function expressions instead of arrow functions
Color Property ErrorsNon-existent Color properties
Interface Method Signature ErrorsMethod signature mismatches in object literals
AvoidArea Type ErrorsMissing visible property in AvoidArea type
Standalone Function this ErrorsUsing this in standalone functions
TitleButtonRect Type ErrorsIncorrect return type for getTitleButtonRect; accessing non-existent properties (left, top)
Catch Clause Type ErrorsType annotations in catch clauses
ESObject Type ErrorsRestricted usage of ESObject type
Resource Conversion ErrorsResource to string/number conversion errors
Unused Variable WarningsDeclared but never used variables
IDataSource Type ErrorsLazyForEach requires IDataSource implementation
Duplicate Entry ErrorsMultiple @Entry decorators in same file
Possibly Null ErrorsObject possibly null when accessing properties

Quick Reference

Error TypeSolution
Notification type errorCast to number type
Window type errorUse callback pattern for getLastWindow
AppStorage type errorUse @StorageLink with LocalStorage or AppStorage.setAndLink (avoid setOrCreate)
Object spread errorExplicitly type objects
@StorageLink default value errorAdd = undefined or specific default value
Object literal interface errorDefine interface before using object literal
Object literal type errorDefine interface and use it as return type
Function return type errorAdd explicit return type annotation
Arrow function conversion errorConvert function to arrow function =>
Color property errorUse hex color values instead of non-existent Color properties
Interface method signature errorUse property syntax method: () => {} instead of method syntax
AvoidArea type errorAdd visible: false property to AvoidArea object
Standalone function this errorPass context as parameter: function foo(context: Context)
TitleButtonRect type errorUse window.TitleButtonRect instead of window.Rect; only width and height properties available
Catch clause type errorRemove type annotation or use any/unknown
ESObject type errorUse ESModule or specific types instead of ESObject
Resource conversion errorUse Resource directly in UI components or use ResourceManager
Unused variable warningUse console.info/hilog or delete unused variable
IDataSource type errorImplement IDataSource interface for LazyForEach
Duplicate Entry errorRemove extra @Entry, use @Component for child components
Possibly Null errorUse !== null check or optional chaining

Detailed Error Solutions

Notification API Type Errors

Window API Type Errors

AppStorage Type Errors

Object Spread Type Errors

@StorageLink Default Value Errors

Object Literal Interface Errors

Object Literal Type Errors

Function Return Type Errors

Arrow Function Conversion Errors

Color Property Errors

Interface Method Signature Errors

AvoidArea Type Errors

Standalone Function this Errors

TitleButtonRect Type Errors

Catch Clause Type Errors

ESObject Type Errors

Resource Conversion Errors

Unused Variable Warnings

IDataSource Type Errors

Duplicate Entry Errors

Possibly Null Errors

Window Rect/Size Type Errors

Related Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated