Getting Intellij to recognize JS Module from Gradle

I a project that also includes Android I’m having an issue to get intellij to recognize the fact that my module is a javascript module. It uses the correct library and kotlin2js plugin for gradle, but on sync the module is recognized as targeting the JVM. When I open module settings and manually configure the target to be JavaScript it works, but that is overwritten on gradle sync. Is this a bug, or am I doing something wrong? Btw. It compiles under gradle.

This is a bug. Could you please file an issue and attach your build.gradle? Thanks!

I’ve filed a bug https://youtrack.jetbrains.com/issue/IDEA-169600 and attached a small subset that exposes this. It really only triggers when the android gradle thing is triggered (the default gradle plugin works).