Richard
Richard

Reputation: 183

kotlinc-js 1.8 doesn't seem to support IR

When compiling using the kotlin 1.8 sdk, for example :

kotlinc-js -version

One gets the following:

info: kotlinc-js 1.8.0 (JRE 19.0.1)
error: ==========
This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release.

Please migrate your project to the new IR-based compiler (https://kotl.in/jsir).
Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle.

You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler.
==========

The implication of this seems to be that the IR js compiler can be used from Gradle - which seems a really annoying limitation. Is this really this case?

Upvotes: 1

Views: 255

Answers (1)

JSMonk
JSMonk

Reputation: 126

For the 1.8.0 version you have two options:

  • You can use the IR compiler with the -Xir-produce-js flag.
  • You can still use the legacy compiler but you need to provide the flag -Xuse-deprecated-legacy-compiler.

Upvotes: 0

Related Questions