MrPowerGamerBR
02/09/2020, 3:07 PMEnumClassHere.values()
in the Kotlin/JS project, it fails with
As a workaround I added this to my enum class in the multiplatform projectTypeError: can't access property "values", $module$loritta_<http://api.net|api.net>.perfectdreams.loritta.api.commands.CommandCategory is undefined
init {
CommandCategory.values().forEach {}
}
...and it worked without any issues! Is this a known issue? (and yes, I did try disabling Kotlin DCE on my JS project, but even with it disabled the error still happened)Ivan Kubyshkin [JetBrains]
02/10/2020, 11:02 AMMrPowerGamerBR
02/10/2020, 12:11 PMinit
block.
But then I hit another similar bug. now when trying to run the JS project it throws TypeError: can't access property "prototype", LorittaBot is undefined
, compiling the JVM target works fine.
Here's the source code: https://github.com/LorittaBot/Loritta/tree/feature/command-dsl
You don't need to compile everything, just compile the :loritta-website:spicy-morenitta
module (it is for the frontend)
There is some JS libs that are required to run, so to makes things easier I made a small zip file that contains all dependencies and index.html
that loads the js files in the right order: https://cdn.discordapp.com/attachments/475830618895155201/676399727729836033/lori_asset_bug.zipMrPowerGamerBR
02/10/2020, 12:17 PMgradle build clean
the issue simply vanished.MrPowerGamerBR
02/10/2020, 12:21 PMclean
. I think that adding the init
block just caused the compiler to "omg I need to compile this class because it was changed" and that fixed the issue.Ivan Kubyshkin [JetBrains]
02/10/2020, 1:41 PMMrPowerGamerBR
02/10/2020, 3:20 PMgradle clean
on the multiplatform project, so it is not a huge issue, but thanks for helping 🙂