No kotlin.js file output by kotlinc

Currently trying to get a Kotlin "Hello, World" to compile to JS via the command line. I've followed the tutorial:

https://kotlinlang.org/docs/tutorials/javascript/getting-started-command-line/command-line-library-js.html

I'm seeing the Javascript files being generated, but I'm missing the kotlin.js file that I would expect to see per: https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html

The first few lines of the generated JS files read: if (typeof kotlin === 'undefined') { throw new Error("Error loading module 'sample-library'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'sample-library'."); } if (typeof kotlin === 'undefined') { throw new Error("Error loading module 'sample-library'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'sample-library'."); }

so it's clear that the it's meant to be run with a file that instantiates kotlin . Any ideas why I'm not seeing it? I'm following the tutorial exactly as written. I'm using the latest version of the compiler from homebrew, which is 1.1.2.2


As described here, yes, you'll need to include kotlin.js before you can run your own Kotlin code. This file contains the Kotlin runtime and standard library.

If you're doing this from the command line, you can find kotlin.js in the lib folder of the compiler, inside kotlin-stdlib-js.jar (which you can just open as a regular .zip file).

链接地址: http://www.djcxy.com/p/96314.html

上一篇: Node.js应用程序部署在heroku中

下一篇: kotlinc没有输出kotlin.js文件