react-query-firebase icon indicating copy to clipboard operation
react-query-firebase copied to clipboard

Firebase Error logging in console when fetching data although data is fetched correctly.

Open emmanuelosayame opened this issue 3 years ago • 7 comments

Screenshot from 2022-07-15 00-11-10

This happens in nextJs...

emmanuelosayame avatar Jul 14 '22 23:07 emmanuelosayame

I have the same thing! Sometimes I cant even run my project... Did you solve the issue?

Fifaldi avatar Jul 25 '22 07:07 Fifaldi

Could you show some code? What causes this to trigger etc?

Ehesp avatar Jul 25 '22 09:07 Ehesp

In my case the thing causing it is custom hook to query the Firestore. I am using react query to make calls to firestore api, so my code looks like this:

    icon: string;
    title: string;
    description: string;
};

export const useRestaurantCooperation = () => {
    const ref = query(
        collection(
            firebaseInstance.firebaseDatabase,
            QUERY.HOME.RESTAURANT_COOPERATION,
        ).withConverter<IRestaurantCooperationFactor>(
            new Converter<IRestaurantCooperationFactor>(),
        ),
    );
    return useFirestoreQuery([QUERY.HOME.RESTAURANT_COOPERATION], ref);
};

After I created this hook and used it I get this error when starting project (yarn dev):

image

Now I cant start the project even if I switch to another branch without my changes. Funny thing is that my cooworkers get the same error but despite that the project starts normally

Fifaldi avatar Jul 26 '22 07:07 Fifaldi

It happens in all queries. I used the same ref on two other hooks and also on the getDocs function, it worked just fine

It seems like it’s doesn’t affect anything, it just displays the warning

emmanuelosayame avatar Aug 01 '22 00:08 emmanuelosayame

Running into the same issue. Doesn't seem to affect anything though

richiboi avatar Aug 14 '22 04:08 richiboi

Running into the same issue. Cant run a build due to this breaking the build process in nextjs.

raphrstuff avatar Sep 01 '22 17:09 raphrstuff

I had to switch to swr-firestore, althought I ended up not using both. firestore caching was enough afterall, just use the realtime functionality

emmanuelosayame avatar Sep 01 '22 23:09 emmanuelosayame