#useRouteData empty on HMR

1 messages · Page 1 of 1 (latest)

weary linden
#

I'm just curious about the expected behavior of useRouteData in Solid Start. It seems to return an empty response after HMR, but only in certain situations. I created two identical pages with different route data functions. One pulls from the Pokemon API and another accesses my firestore instance:

    return createServerData$(async () => {
        const resp = await fetch("https://pokeapi.co/api/v2/pokemon/ditto");
        return await resp.json();
    });
};```

```export const routeData = () => {
    return createServerData$(async () => {
        const exercisesSnapshot = await db.exercises.get();
        return exercisesSnapshot.docs.map(doc => ({ id: doc.id, ...doc.data() }));
    });
};```

The Pokemon page seems to persist data through HMRs, however, my route data from firestore seems to be empty after an HMR. Does anyone have any insight into this?
weary linden
#

Bump. Still haven’t solved this. Don’t want to file an issue as it’s probably just something I’m misunderstanding