Intellij Idea is not recognizing the dart project correctly since using melos

173 Views Asked by At

I upgraded my project to be based on a multi-package architecture a few weeks ago. My primary pubspec.yaml contains path references to those feature or library packages.

To be able to manage this mono-repo I recently introduced melos.

Now I have the problem that I cannot use Intellij any more as it doesn't recognize the project correctly:

  • I don't see any project errors any more
  • I don't see any code suggestions any more
  • I cannot use shortcuts any more to e.g. jump into the implementation or the definition of a class
  • and so on (The project structure seems to be broken)

What I tried to address this issue so far:

  • I already ran Repair IDE in Intellij with all checkboxes marked including Invalidate Caches & Restart in the end
  • I did this again but ran melos clean before and melos bs (bootstrap) after restart.
  • I checked my melos.yaml to see that all the packages are correctly referenced.

So what else could be the problem for such a behaviour?

Running the project in VS Code works so it is related to Intellij.

1

There are 1 best solutions below

0
On

I found the issue:

Short answer --> manually delete all your iml files and run melos bs again

Explanation: melos automatically creates iml files which are named like melos_module.iml. Two of my packages still had an old iml file called module.iml. melos clean on the other hand didn't remove all iml files nor did Repair IDE do such a thing. So the problem with the two redundant files was never solved.

After manually removing all iml files in the project and running melos bs again I have a running project again.