is there a npm package for coroutines? I’m failing...
# javascript
f
is there a npm package for coroutines? I’m failing at the google
a
The amount included in kotlin-stdlib-js is extremely minimal. If you are looking for kotlinx-coroutines-js (https://github.com/Kotlin/kotlinx.coroutines/blob/master/js/README.md), it is not published to NPM at the moment.
f
Yeah, that's what I'm looking for... I've been messing around with kotlinjs for Google cloud functions (gcp's version of AWS lambda). I can't get it to work with bundles, which means I need to use npm for uploading dependencies, which means I can't use coroutines :(
a
Oh I see. cc @elizarov
@fitzoh What is the problem with bundles by the way? (just wondering)
f
I’m not entirely sure, I’ve spent hours thrashing with the webpack config. Sometimes I’m able to upload the function and it never terminates when I trigger it (times out after 60 seconds), other times I’m not able to upload it because the GCF uploader can’t find the main exported file
a
@fitzoh Sorry to hear that. Does it work locally? Is it a problem with GCF not understanding large bundles, or is the bundle plain wrong?
f
If I run
node <bundle>.js
locally it works and terminates
it’s possible it’s a GCF thing
a
That's unfortunate. =( Do they allow scoped dependencies? I mean you could try publishing and using something like
@fitzoh/kotlinx-coroutines-js
f
That sounds reasonable, I’ll try looking into that
So I tried pulling the kotlinx js artifacts from bintray, ended up with kjsm files… Trying to build it from source locally now, gradle build is failing with:
Copy code
A problem occurred starting process 'command 'null/bin/java''
> Could not start 'null/bin/java'
a
@fitzoh Are
.js
,
.js.map
, and
.meta.js
missing? Just publish the content of https://bintray.com/kotlin/kotlinx/download_file?file_path=org%2Fjetbrains%2Fkotlinx%2Fkotlinx-coroutines-core-js%2F0.21.2%2Fkotlinx-coroutines-core-js-0.21.2.jar to NPM (possibly without META-INF)
f
I think I just missed them when I unzipped the jar 😮
a
😃