Hi all - i’m getting this error thrown `TypeError:...
# koin
x
Hi all - i’m getting this error thrown
TypeError: elements.iterator_62 is not a function
while trying to consume koin from a typescript client. More code in the thread
I have a
:core
multi platform module that has this extension in
commonMain
Copy code
@JsExport
fun initKoin(modules: List<Module>): KoinApplication = startKoin {
  modules(modules)
}
:core
build script looks like this
Copy code
kotlin {
  ...

  js(IR) {
    useCommonJs()
    binaries.library()
    browser()
  }

  sourceSets {
    val commonMain by getting {
      dependencies {
        api(InsertKoin.koinCore)
        ...
      }
    }

    ...

    val jsMain by getting {
      dependencies {
        ...
      }
    }
  }
}

npmPublishing {
  organization = organisation
  version = Version.name
}
and i have a react-ts app whose npm dependencies are set up like
Copy code
"dependencies": {
    "@org/core": "file:../../core/build/publications/npm/js",
    ...
    "kotlin": "^1.5.10",
}
When i use the exported function like this,
Copy code
// App.tsx
import {core} from "@org/core";

const initKoin = core.di.initKoin;
const coreDataModule = core.data.coreDataModule;

const koin = initKoin([
    coreDataModule
]);
i get this exception thrown from the browser
Copy code
TypeError: elements.iterator_62 is not a function
HashSet.push.../../core/build/publications/npm/js/PSCore-core.js.AbstractMutableCollection.addAll_23
.../core/build/publications/npm/js/core.js:6311
Am i missing something here? 🤔