I have a very large multiproject build which has few dozens of scala submodules. Historically all scala submodules used the scalaTools configuration. To avoid deprecation issue, I've removed the scalaTools configuration dependencies from all submodules. This led to issue "Cannot infer Scala class path because no Scala library jar was found..." (failing ideaProject task): https://gist.github.com/szczepiq/bf047688a00c967e19ab
I found out that some of the scala submodules did not declare the scala library dependency. After adding missing dependency, the idea task works ok. I use configure on demand but I don't think it is related. Anyhow, it seems that the error could be improved otherwise it is hard to track down what project is missing the scala library.