DivMode
DivMode
Explore posts from servers
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
Wow figured out what was happening just now:
import { undefined, z } from "zod";
import { undefined, z } from "zod";
Some reason undefined was being imported. After removing it works as it should.
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
Alright I suppose it isnt that big of an issue atm since I can return null, thought it might be some kind of bug returning undefined in zod. Ill just keep it as it is, appreciate you trying to help.
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
No description
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
beginning of the function
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
No description
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
have it parsed like this: const parsedData = domainInput.parse({ task: data }); I did notice when I return null it works fine, only when its undefined do I get that type error
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 8/24/2023 in #questions
Zod not returning undefined
data is coming from a 3rd party api and going into prisma
16 replies
TTCTheo's Typesafe Cult
Created by DivMode on 7/6/2023 in #questions
Regex cutting off anything after space in the url
5 replies
TTCTheo's Typesafe Cult
Created by DivMode on 7/6/2023 in #questions
Regex cutting off anything after space in the url
hmm it just seems to not match anything
5 replies
TTCTheo's Typesafe Cult
Created by DivMode on 3/8/2023 in #questions
prefetchInfinite causing query on initial load
When turning off prefetch it does a double query. Turned off intersection observer and that doesnt seems to be it either.
4 replies
TTCTheo's Typesafe Cult
Created by DivMode on 3/8/2023 in #questions
prefetchInfinite causing query on initial load
const {
data,
hasNextPage,
fetchNextPage,
isError,
isFetching,
isLoading,
refetch,
} = trpc.domain.getAll.useInfiniteQuery(
{
recordsPerPage: 30,
query: debounced,
sorting,
activeAuctions,
filters,
},
{
getNextPageParam: (lastPage) => {
// @ts-ignore
const totalPages = Math.floor(lastPage.estimatedTotalHits / lastPage.limit);
// @ts-ignore
const actualPage = lastPage.offset / lastPage.limit;
return actualPage < totalPages ? actualPage + 1 : undefined; // By returning undefined if there are no more pages, hasNextPage boolean will be set to false
},
staleTime: Infinity,
cacheTime: Infinity,
keepPreviousData: true,
refetchOnMount: false,
refetchInterval: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
},
);
const {
data,
hasNextPage,
fetchNextPage,
isError,
isFetching,
isLoading,
refetch,
} = trpc.domain.getAll.useInfiniteQuery(
{
recordsPerPage: 30,
query: debounced,
sorting,
activeAuctions,
filters,
},
{
getNextPageParam: (lastPage) => {
// @ts-ignore
const totalPages = Math.floor(lastPage.estimatedTotalHits / lastPage.limit);
// @ts-ignore
const actualPage = lastPage.offset / lastPage.limit;
return actualPage < totalPages ? actualPage + 1 : undefined; // By returning undefined if there are no more pages, hasNextPage boolean will be set to false
},
staleTime: Infinity,
cacheTime: Infinity,
keepPreviousData: true,
refetchOnMount: false,
refetchInterval: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
},
);
4 replies
TTCTheo's Typesafe Cult
Created by DivMode on 3/8/2023 in #questions
prefetchInfinite causing query on initial load
export async function getStaticProps() {
const ssg = createProxySSGHelpers({
router: appRouter,
ctx: await createContextInner(),
transformer: superjson,
});

await ssg.domain.getAll.prefetchInfinite({
recordsPerPage: 30,
query: "",
sorting: [{
id: "godaddyDomainData.auctionEndTime",
desc: true,
}],
activeAuctions: true,
filters: {
query: {
items: [{ type: "cond", data: {} }],
},
},
});

return {
props: {
trpcState: ssg.dehydrate(),
},
revalidate: 3600,
};
}
export async function getStaticProps() {
const ssg = createProxySSGHelpers({
router: appRouter,
ctx: await createContextInner(),
transformer: superjson,
});

await ssg.domain.getAll.prefetchInfinite({
recordsPerPage: 30,
query: "",
sorting: [{
id: "godaddyDomainData.auctionEndTime",
desc: true,
}],
activeAuctions: true,
filters: {
query: {
items: [{ type: "cond", data: {} }],
},
},
});

return {
props: {
trpcState: ssg.dehydrate(),
},
revalidate: 3600,
};
}
4 replies
TTCTheo's Typesafe Cult
Created by DivMode on 11/1/2022 in #questions
No longer able to set background images in css with nextjs 13?
Thanks got it working now
3 replies