Weird type errors with next.js and drizzle

//when I use
export const dynamicParams = false;
//or
export const dynamicParams = true;
//when I use
export const dynamicParams = false;
//or
export const dynamicParams = true;
Next gives me these errors: - "false" is not a valid value for the "dynamicParams" option. - "true" is not a valid value for the "dynamicParams" option. Also, in this code the function getPostFromSlug is returning a weird type
export type ModifyKeys<T, R> = Record<keyof T, R>;
export const findFirstPost = cache(db.query.posts.findFirst);

//this function returns Promise<{} | undefined> for some reason
export const getPostFromSlug = async (
slug: string,
columns: Partial<ModifyKeys<Post, boolean>> = {
slug: false,
publishedAt: false
}
) => {
return await findFirstPost({
columns,
where: eq(posts.slug, slug)
});
};
export type ModifyKeys<T, R> = Record<keyof T, R>;
export const findFirstPost = cache(db.query.posts.findFirst);

//this function returns Promise<{} | undefined> for some reason
export const getPostFromSlug = async (
slug: string,
columns: Partial<ModifyKeys<Post, boolean>> = {
slug: false,
publishedAt: false
}
) => {
return await findFirstPost({
columns,
where: eq(posts.slug, slug)
});
};
0 Replies
No replies yetBe the first to reply to this messageJoin