# Can't add kotlinx to a fresh Kotlin/JS project

**URL:** <https://discuss.kotlinlang.org/t/cant-add-kotlinx-to-a-fresh-kotlin-js-project/18562>\
**Category:** JavaScript\
**Created:** [July 24, 2020, 9:04pm UTC](https://discuss.kotlinlang.org/t/cant-add-kotlinx-to-a-fresh-kotlin-js-project/18562 "2020-07-24T21:04:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony.naddeo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/anthony.naddeo/32/7771_2.png) [@anthony.naddeo](https://discuss.kotlinlang.org/u/anthony.naddeo)\
**Post date:** [July 24, 2020, 9:04pm UTC](https://discuss.kotlinlang.org/t/cant-add-kotlinx-to-a-fresh-kotlin-js-project/18562/1 "2020-07-24T21:04:52Z")

</div>

Trying to figure out what I’m doing wrong. I created a small video of exactly what I’m doing in IntelliJ on Windows.

[![](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/a/a9c6f30907745486565b6a1fd30aa182f6424bd6.jpeg "Trouble using kotlinx.coroutines from a fresh Kotlin/JS project") ](https://www.youtube.com/watch?v=nIH_55Zbxus)

And I’ll describe it here in text.

- Create a new project
- Tick the Gradle \> Kotlin/JS for browser template and untick everything else
- Add `implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'` to the dependencies block in the build.gradle.
- Sync the gradle files
- Attempt to use something from the `kotlinx.coroutines` namespace

Hopefully its just a silly thing I’m missing. I expected to just have to add the coroutines library to be able to actually import it. It looks like the library is listed in the project structure for the main module so I’m not sure what else might be wrong. [Here is a repo](https://github.com/naddeoa/kotlin-js-issue) of the project too.

```auto
plugins {
    id 'org.jetbrains.kotlin.js' version '1.3.72'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
    testImplementation "org.jetbrains.kotlin:kotlin-test-js"
}

kotlin.target.browser { }

```

 ![Annotation 2020-07-24 140346](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/3/3ff418b992e373e796439510cd1d56bc6b124715.jpeg)

---

<div class="post-metadata">

**Author:** ![anthony.naddeo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/anthony.naddeo/32/7771_2.png) [@anthony.naddeo](https://discuss.kotlinlang.org/u/anthony.naddeo)\
**Post date:** [July 25, 2020, 10:16pm UTC](https://discuss.kotlinlang.org/t/cant-add-kotlinx-to-a-fresh-kotlin-js-project/18562/2 "2020-07-25T22:16:53Z")

</div>

Looks like it was just a matter of adding the JS version of the coroutines package

> **[Maven Central Repository Search](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.3.8/jar)**
>
> Official search by the maintainers of Maven Central Repository

---

<div class="post-metadata">

**Author:** ![ivan.kubyshkin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/ivan.kubyshkin/32/7066_2.png) [@ivan.kubyshkin](https://discuss.kotlinlang.org/u/ivan.kubyshkin)\
**Post date:** [July 26, 2020, 9:19pm UTC](https://discuss.kotlinlang.org/t/cant-add-kotlinx-to-a-fresh-kotlin-js-project/18562/3 "2020-07-26T21:19:36Z")

</div>

> <https://stackoverflow.com/questions/63082406/cant-add-kotlinx-to-a-fresh-kotlin-js-project/63093430#63093430>
