Hey folks, I'm looking to integrate Kotlin/JS into...
# javascript
i
Hey folks, I'm looking to integrate Kotlin/JS into an existing KMM project and just doing some experimenting here before diving in, but running into some issues as all samples are based around the web project being built with kotlin. Instead we want to set it up that the web project knows nothing about kotlin, the web project just imports a javascript package that happens to contain all the shared application code. In Andorid/iOS the common code portion spits out as an android lib/xcode framework. I've got as far as generating a javascript module (using Kotlin/JS IR) but am stuck with this error - and a lack of knowledge of the JS ecosystem:
Cannot find module 'shared' or its corresponding type declarations.
The module is imported to the web project with
"shared": "file:../build/js/packages/shared"
and into the javascript file with
import { Platform } from 'shared';
Any idea where I may be going wrong?
r
The only thing I can think of is using
./build/js/packages/shared/kotlin
instead, as per https://kotlinlang.org/docs/js-ir-compiler.html#preview-generation-of-typescript-declaration-files-d-ts. It seems right to me other than that though.
i
no luck unfortunately
Progress! I needed to run
npm install
and now the modules picked up (still haven't quite got the import of
Platform
, but at least a different error message!)