Issue: Integration Problems with kotlin-suspend-transform-compiler-plugin #53
Closed
DarshanNairDiscovery
started this conversation in
General
Replies: 1 comment
-
Hi, suspendTransform {
enabled = true
includeRuntime = true
useJsDefault() // Using the default annotation and runtime configurations
} This can be triggered by annotation information that is not configured by default. About the suspendTransform {
enabled = true
includeRuntime = true
// useJsDefault()
addJsTransformers(
SuspendTransformConfiguration.jsPromiseTransformer.copy(
copyAnnotationExcludes = listOf(
ClassInfo("kotlin.js", "JsExport.Ignore")
)
)
)
} and the @file:OptIn(ExperimentalJsExport::class)
import kotlinx.coroutines.delay
import love.forte.plugin.suspendtrans.annotation.JsPromise
@JsExport
class MyClass {
@JsPromise
@JsExport.Ignore
suspend fun fetchData(): String {
delay(1000)
return "Hello from Coroutine"
}
} If a type Nullable<T> = T | null | undefined
export declare class MyClass {
constructor();
fetchDataAsync(): Promise<string>;
}
export declare namespace MyClass {
class $fetchDataCOROUTINE$0 /* extends CoroutineImpl */ {
constructor(_this_: MyClass, resultContinuation: any/* Continuation<string> */);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to integrate this lib and getting error:
Problems
IDE Error:
Even after using @JsPromise, I get the following IDE error:
Declaration of such kind (suspend function) can't be exported to JS
Runtime Error:
When running jsBrowserDevelopmentExecutableDistribution, I receive the following error:
Am not able to RCA this, can you help where am going wrong please?
Beta Was this translation helpful? Give feedback.
All reactions