Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
1 reply
Perry

Weird type errors with next.js and drizzle

//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)
  });
};
Was this page helpful?