scala.js: IDEA does not find individual JS and JVM implementations of an object, sbt compile / sbt test works fine Follow
I have a crossProject which has JVM, JS and shared sources. Now, in jvm and js directories, I have individual implementations of an object, let's call it "somepackage.SomeObject" for now.
When I now reference this object somewhere in the "shared" source tree, IDEA highlights it as an error (i.e., makes it red) and complains it cannot find the object. However, "Build / Rebuild project" works, and "sbt compile" too.
Is this bug or some misconfiguration of my project structure?
Please sign in to leave a comment.
I investigated some more, and found out that when putting the individual implementations in a separate crossProject and adding it as a dependency via dependsOn, they are referenced correctly and found by IDEA. So for now, as a workaround, I do the following:
For googling posterity ... this appears to still be an issue as of April 2022, and it has a YouTrack: https://youtrack.jetbrains.com/issue/SCL-18334/sbt-crossproject-shared-sources-do-not-see-jvm-js-sources