Skip to content

Calling launch in kotlinjs causes a TypeError to be logged #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ansman opened this issue Apr 19, 2018 · 5 comments
Closed

Calling launch in kotlinjs causes a TypeError to be logged #340

ansman opened this issue Apr 19, 2018 · 5 comments

Comments

@ansman
Copy link
Contributor

ansman commented Apr 19, 2018

If you compile the following code and execute it:

fun main(args: Array<String>) {
  launch {}
}

You get the following exception printed to the terminal:

TypeError: throwCCE is not a function
@qwwdfsad
Copy link
Collaborator

I can't reproduce this problem on my machine.
Could you please provide more details (node.js version, Kotlin version, build script etc.) or self-contained project example?

@ansman
Copy link
Contributor Author

ansman commented Apr 22, 2018

Sure, no problem. I've attached a same project.

Just cd in to the dir and run npm run bug

coroutines-bug.zip

@SeekDaSky
Copy link

SeekDaSky commented May 1, 2018

I had the same bug and resolved it, when you include kotlin and kotlinx-coroutines-core in your package.json, kotlinx-coroutines-core will download kotlin as a dependency and put it in its own node_modules, leading to a conflict between kotlin installed by package.json and the one installed by kotlinx-coroutines-core, if you remove kotlin from package.json everything works fine. It looks like the kotlinx-coroutines-core npm package can't detect when the package.json already contain kotlin

@ansman
Copy link
Contributor Author

ansman commented May 1, 2018

Seems like it could be solved by fixing #339 then

ansman added a commit to ansman/kotlinx.coroutines that referenced this issue May 1, 2018
elizarov pushed a commit that referenced this issue May 14, 2018
@SUPERCILEX
Copy link
Contributor

@elizarov any idea when this will be released? Or are there snapshot builds we could use? Coroutines are basically unusable in JS, seems like a big deal. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants