const chain = EvmChain.GOERLI;
async function getOwners() {
await Moralis.start({ apiKey: process.env.NEXT_PUBLIC_MORALIS_API_KEY });
const response = await Moralis.EvmApi.nft.getNFTOwners({
address: GLIMMERS_GOERLI_ADDRESS,
chain,
});
const responseJson = JSON.stringify(response);
return responseJson;
}
const queryClient = new QueryClient();
const STALE_TIME = 10000;
export async function getServerSideProps(context) {
await queryClient.prefetchQuery(["getOwners"], getOwners, {
staleTime: STALE_TIME,
});
return {
props: {
dehydratedState: dehydrate(queryClient),
},
};
}
export default function Dashboard() {
const { data: rawOwners } = useQuery(["getOwners"], getOwners, {
staleTime: STALE_TIME,
});
console.log(rawOwners); // <- this returns undefined ONLY on vercel
const chain = EvmChain.GOERLI;
async function getOwners() {
await Moralis.start({ apiKey: process.env.NEXT_PUBLIC_MORALIS_API_KEY });
const response = await Moralis.EvmApi.nft.getNFTOwners({
address: GLIMMERS_GOERLI_ADDRESS,
chain,
});
const responseJson = JSON.stringify(response);
return responseJson;
}
const queryClient = new QueryClient();
const STALE_TIME = 10000;
export async function getServerSideProps(context) {
await queryClient.prefetchQuery(["getOwners"], getOwners, {
staleTime: STALE_TIME,
});
return {
props: {
dehydratedState: dehydrate(queryClient),
},
};
}
export default function Dashboard() {
const { data: rawOwners } = useQuery(["getOwners"], getOwners, {
staleTime: STALE_TIME,
});
console.log(rawOwners); // <- this returns undefined ONLY on vercel