useRouteData empty on HMR

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:
export const routeData = () => {
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 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() }));
});
};
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?
2 Replies
alrightsure
alrightsure17mo ago
Bump. Still haven’t solved this. Don’t want to file an issue as it’s probably just something I’m misunderstanding
mdynnl
mdynnl17mo ago
i don't think context hmr is solved yet, probably worth an issue though
Want results from more Discord servers?
Add your server