I am using Yested (a Kotlin JS library) in a Kotlin JS project. With Kotlin 1.03 it was working, but after I updated to Kotlin 1.0.5, somehow it isn’t working anymore. If I try to go back to Kotlin 1.0.3, my IntelliJ plugin can’t read the files. I’d rather stick with 1.0.5 anyway, but with 1.0.5 I’m getting is this error in the browser JS console:
webclient_main.js:1180 Uncaught TypeError: Cannot read property ‘yested’ of undefined
on this line:
var div = _.net.yested.with_ji1yox$(new _.net.yested.Div(), _.client.main_kand9s$f);
The .js files for both yested and webclient_main seem to define _. Each project’s .js file declares its own _, but I don’t see anything that pulls in yested into webclient. I’m using KotlinJS’s Module kind of “Plain (put to global scope)”.
I tried calling require(“Yested”), but that didn’t compile because it tried to use a require method that takes a boolean, not a string.
I’ve encountered a similar issue. The problem is that somehow the library is not treated as a library. What build system do you use. I’m using gradle. The strange thing is that external libraries (kotlinx.html) did work.
I’m using gradle in the consuming project, but I’m actually building it in IntelliJ with Ctrl+Shift+F9 after importing it from gradle. Yested uses maven.
I don’t see anything that pulls in yested into webclient
What did pull in Yested into web client before you switched to 1.0.5?
Looks like Yested is not actively developed anymore. It’s pom.xml file tells that framework is built for Kotlin 1.0.2, which is pretty old, and I dont know how you could make it work with 1.0.5. 1.0.2 and 1.0.5 are simplly incompatible between each other. Anyway, you provided too few information. What code are you compiling? What is the stack trace? How do you load JS files?
Remove Specification-Title entry and recompile Yested. That’s because presence of Specification-Title and Kotlin-JS-Module-Name indicates that a module is an “Old Kotlin JS module” (modules like these don’t provide serialized metainformation, their declarations are resolved from packed source code). Kotlin 1.0.5 has broken support of “Old Kotlin JS modules”, and we still not sure what to do: either remove them completely or fix them (which is a little compicated).
Also, you can remove kt sources from Yested jar file, i.e. remove following lines from pom.xml: