Type mismatch inferred type is () -> Unit but FlowCollector was expected
Probably, you are using the direct collect() function on Flow. For your syntax, you need to import the collect() extension function. (and I really wish that they did not name these the same…)