`createAsync` crashing my app
Hi everyone.
When I add this second
Code:
When I add this second
createAsynccreateAsync my app crashes:const contactsAndSocial = createAsync(() => getSocialNetworksAndContacts());const contactsAndSocial = createAsync(() => getSocialNetworksAndContacts());__vite_ssr_import_7__.getSocialNetworksAndContacts is not a function__vite_ssr_import_7__.getSocialNetworksAndContacts is not a function
Code:
// getSocialNetworksAndContacts
const getSocialNetworksAndContacts = cache(
async (): Promise<SocialNetworksAndContacts> => {
'use server';
try {
return client.fetch<SocialNetworksAndContacts>(getSocialNetworksAndContactsQuery);
} catch {
return {
social: [],
contacts: [],
};
}
},
'social-networks-and-contacts',
);
// getSocialNetworksAndContactsQuery
const getSocialNetworksAndContactsQuery = `
*[_type == "settings"] [0] {
"contacts": coalesce(contacts, []),
"social": coalesce(social, [])
}
`;// getSocialNetworksAndContacts
const getSocialNetworksAndContacts = cache(
async (): Promise<SocialNetworksAndContacts> => {
'use server';
try {
return client.fetch<SocialNetworksAndContacts>(getSocialNetworksAndContactsQuery);
} catch {
return {
social: [],
contacts: [],
};
}
},
'social-networks-and-contacts',
);
// getSocialNetworksAndContactsQuery
const getSocialNetworksAndContactsQuery = `
*[_type == "settings"] [0] {
"contacts": coalesce(contacts, []),
"social": coalesce(social, [])
}
`;