Because neither the above nor other similar posts helped me..
I got this error when calling set data and then immediately after .getDocument(...) (i.e. reading data). When I called my read data method in the completion handler of the setData method then the error message disappeared.