Trying to add js target to an existing Android/iOS...
# javascript
t
Trying to add js target to an existing Android/iOS MP library. When I try to add npm dependency, I get:
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':salonbizlibrary:jsPackageJson'.
> NPM Dependencies already resolved and installed
This is the js sestion:
Copy code
jsMain {
            dependencies {
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutines_version"
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$serialization_version"

                implementation "io.ktor:ktor-client-js:$ktor_version"
                implementation "io.ktor:ktor-client-core-js:$ktor_version"
                implementation "io.ktor:ktor-client-json-js:$ktor_version"
                implementation "io.ktor:ktor-client-serialization-js:$ktor_version"

                //implementation(npm("moment", "2.24.0"))
                implementation(npm("crypto-js", "3.1.9-1"))
            }
        }
If I do not include the npm dependency, it builds fine.
I also do not see any kind of npm_modules directory being created. Perhaps I need an explicit npm plugin defined, or some other config options defined?
p
Check build/js folder if u setup target correctly u get node_modules there after running jsRun task in gradle
t
Ah, I completely missed the other js tasks since they were hiding under ‘other’, and I was only looking at ‘build’. So now to figure out how to allow jsRun/jsNodeRun/jsBrowserRun to do something useful…