-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error when using node.process.process
#2221
Comments
For Node.js applications you need use CommonJS or ES module (both modular). kotlin {
js {
useCommonJs()
// useEsModules() (fine default for Node and Browser)
}
} also you configure module kind like here |
The usage is in context of a Kotlin/JS library targetting nodejs. Is choosing one of CommonJS or ES modules instead of UMD going to impact Kotlin/JS applications using the library? I.e. will it force the chosen module system on them? |
Partially. In Kotlin Wrappers we support modular declarations only.
|
Alright, this doesn't apply to my case, the Kotlin/JS library only exports Kotlin declarations (which are handled by klib if I understand correctly) and doesn't have any Should I close this issue? |
* Gradle 8.5 -> 8.6 * Kotlin 1.9.21 -> 1.9.22 * Ktor 2.3.7 -> 2.3.9 * kotlinx.coroutines 1.7.3 -> 1.8.0 * kotlinx.serialization 1.6.2 -> 1.6.3 * kotlin-logging 6.0.1 -> 6.0.3 * SLF4J 2.0.9 -> 2.0.12 * kotlin-node 18.16.12-pre.619 -> 20.11.5-pre.706 * kotlin-multiplatform-bignum 0.3.8 -> 0.3.9 * KSP 1.9.21-1.0.16 -> 1.9.22-1.0.17 * KotlinPoet 1.15.3 -> 1.16.0 * JUnit 5 5.10.1 -> 5.10.2 * MockK 1.13.8 -> 1.13.10 * Dokka 1.9.10 -> 1.9.20 * AtomicFU 0.23.1 -> 0.23.2 * Binary compatibility validator 0.13.2 -> 0.14.0 * gradle-buildconfig-plugin 5.1.0 -> 5.3.5 * Foojay Toolchains Plugin 0.7.0 -> 0.8.0 * gradle/wrapper-validation-action v1 -> v2 * Replace gradle/gradle-build-action with gradle/actions/setup-gradle * Apply useCommonJs() to fix issues with kotlin-node, see JetBrains/kotlin-wrappers#2221
I get this compilation error when trying to use
node.process.process
:Am I doing something wrong or is this a problem with
kotlin-node
? The suggestedJsNonModule
annotation is missing onprocess
: https://github.com/JetBrains/kotlin-wrappers/blob/6444bd21d4146d7d9115c5300d14f573c92e720a/kotlin-node/src/jsMain/kotlin/node/process/process.export.ktThe text was updated successfully, but these errors were encountered: