-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
I want to use it in HarmonyOS.
I integrate according to the document and then generate the js file.
Integrate and invoke this js in deveco-studio and output the following error message.
ReferenceError: localStorage is not defined
TypeError: Cannot load property of null or undefined
The following are my configuration items:
commonMain.dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kstore)
}
androidMain.dependencies {
implementation(libs.kstore.file)
}
iosMain.dependencies {
implementation(libs.kstore.file)
}
val jsCommonMain by getting {
dependsOn(commonMain.get())
}
jsCommonMain.dependencies {
implementation(libs.kstore.storage)
implementation(libs.kotlinx.coroutines.core.js)
}
commonMain:
expect val storeVehicles: KStore
jsMain:
actual val storeVehicles: KStore by lazy {
storeOf(key = "storeCurrentVehicle")
}