-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working on Kotlin 1.4.0 #35
Comments
Seems to work OK for me in 1.4 when using the default (Legacy) compiler. Using the new Alpha IR compiler is when it has issues. Were you using the IR compiler when you had the issue? |
No, the default non-IR one. Please see this commit: fsynthlib/fsynth@2a203fb This is the minimal set of changes to enable 1.4.0, and it reproduces the issue. To reproduce, check out the above commit, call |
Pushed my Kotlin 1.4 version (v0.6) which works for me. Seems pretty similar to what you had, so don't know... |
Thanks, confirmed it works fine so far! (fsynthlib/fsynth@536e5a4) From my point of view, this issue can be resolved. Note: keep it mind that Muirwik v0.6 is not compatible with Kotlin earlier than 1.4.0, so you're forcing all clients wanting to use v0.6+ it to migrate to 1.4.0. It's probably fine for a moving-fast kind of project. |
hey i am also not able to get it work. i'm using kotlin 1.4.0 in multiplattform project. do you have any hint what i'm doing wrong? plugins {
kotlin("js")
}
repositories {
maven("https://dl.bintray.com/cfraser/muirwik")
}
dependencies {
implementation(project(":shared"))
implementation("org.jetbrains:kotlin-react:16.13.1-pre.110-kotlin-1.4.10")
implementation("org.jetbrains:kotlin-react-dom:16.13.1-pre.110-kotlin-1.4.10")
implementation("org.jetbrains:kotlin-styled:1.0.0-pre.110-kotlin-1.4.10")
implementation(npm("react", "16.13.1"))
implementation(npm("react-dom", "16.13.1"))
implementation(npm("styled-components", "5.1.1"))
implementation("com.ccfraser.muirwik:muirwik-components:0.6.0")
implementation(npm("@material-ui/core", "^4.9.14"))
}
kotlin {
js {
browser {
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
}
} when i run my app using a muirwik component i get following error in the browsers console (which leads to complete crash of my react app):
without using muirwik everything works just fine since i'm new to kotlinJS i see the error is saying 'Cannot find module 'kotlin-extensions'' but don't know how to fix it :D Further question: is it needed to have material-ui as a dependency? i'm wondering why the wrappers like muirwik but also the jetbrains ones like for react are not coming with corresponding stuff that is needed anyway as transitive dependency? |
You could have a look at the separate starter project as an example and see if that works for you. For 0.6.0 I use pre.112-kotlin-1.4.0 versions which might be important. And no, you shouldn't need material-UI as a direct dependency now-a-days. |
thx, changing to pre.112-kotlin-1.4.0 works :) |
The Kotlin JS IR compiler is stable since Kotlin 1.5.0 but I can't get Muirwik running on it. With Is there anything you @cfnz can do or should we report it to YouTrack? |
This is a known problem with the Kotlin wrappers and the IR compiler, there is also a known work around. The readme talks about the IR compiler... there is a special IR Branch that includes the work arounds... Sometime soon I will look at merging it into master as it doesn't seem like things are going to change, but in the short term you could try and use that branch. |
I have locally merged the IR branch into my master last week and will release it after a bit more testing. At the moment, legacy is still the way to go for development as the IR compiler is still in Alpha and doesn't support incremental compilation... so the edit rebuild process is way slower using the IR compiler... For a release, I have not compared bundle size, so still plan to do that... So, yes, js(LEGACY) is still needed, and I would say recommended (for now), for development work flow at least. |
I get no compile-time errors, but a runtime one in the browser console:
See my working branch: https://github.com/krzema12/fsynth/commits/1.4.0 (just bumping Kotlin to 1.4.0 and React wrappers to pre.112 is truly meaningful there and enough to reproduce).
I compared if Kotlin JS and Kotlin-React work fine if there's no Muirwik (using my custom Material UI wrappers), and they do. See https://github.com/krzema12/fsynth/commits/1.4.0-without-muirwik
I tried to track down what's the problem, but I failed. Source maps don't load in my browser which is also weird. I only managed to find out that not using Muirwik makes the app work fine on 1.4.0.
Could you check it out?
Thanks,
Piotr
The text was updated successfully, but these errors were encountered: