https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
f

Friedger

04/20/2020, 10:31 AM
I am trying to add a js target to my project that I started from KaMPStart. Running ./gradlew shared:build gives me a can't read property 'prototype' of undefined error:
Copy code
/home/friedger/_repos/github/openintents/stacks-transactions-kotlin/build/js/packages/StacksTransactions-shared/kotlin/StacksTransactions-shared.js:11
}(this, function (_, Kotlin) {
 ^
TypeError: Cannot read property 'prototype' of undefined
    at /home/friedger/_repos/github/openintents/stacks-transactions-kotlin/build/js/packages/StacksTransactions-shared/kotlin/StacksTransactions-shared.js:265:49
Any ideas what is going wrong?
That is my js target definition
Copy code
js {
    nodejs()

    sequenceOf("", "Test").forEach {
      tasks.getByName<KotlinJsCompile>("compile${it}KotlinJs") {
        kotlinOptions {
          moduleKind = "umd"
          noStdlib = true
          metaInfo = true
        }
      }
    }
    compilations["main"].defaultSourceSet {
      dependencies {
        api(kotlin("stdlib-js"))
        implementation(npm("bn.js", "4.11.6" ))
        implementation(npm("elliptic", "6.5.2" ))
      }
    }
    compilations["test"].defaultSourceSet {
      dependencies {
        implementation(kotlin("test-js"))
      }
    }

    mavenPublication {
      artifactId = rootProject.name + "-js"
    }
  }
It looks like missing dependencies