taxonomy icon indicating copy to clipboard operation
taxonomy copied to clipboard

Can't deploy Taxonomy to Vercel

Open feremabraz opened this issue 2 years ago • 6 comments

I tried to deploy Taxonomy on Vercel, I filled every environment variable, including NextAuth, Github, Stripe, Postmark and Planetscale, it works on my local machine, both development and build are OK, no console errors or warnings, but when I deploy it to Vercel, I always get the same error and I don't know how to debug it. Can you help me please?

image

"Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error. ur @ 1038-8ac05e91eb48cd01.js:9"

feremabraz avatar Nov 25 '22 19:11 feremabraz

Not sure if it's the same reason but I've found this from an error being thrown by unstable_getServerSession in the ContentLayer enabled area. Worked around it by redoing the getSession function, although it just means I can't have an auth'ed state in docs.

export const getSession = async (): Promise<Session | null> => {
  try {
    return await unstable_getServerSession(authOptions);
  } catch (error) {
    return null;
  }
};

haydenbleasel avatar Nov 27 '22 03:11 haydenbleasel

@gamekaiju Is this happening on all routes?

shadcn avatar Nov 28 '22 14:11 shadcn

@gamekaiju Is this happening on all routes?

Yes, it is, in all routes.

feremabraz avatar Nov 28 '22 19:11 feremabraz

export const getSession = async (): Promise<Session | null> => { ... }

I don't see why Promise<Session | null> is required. Other than that...

export async function getSession() {
  try {
    return await unstable_getServerSession(authOptions)
  } catch (error) {
    return null
  }
}

...confirmed as a workaround.

feremabraz avatar Nov 29 '22 18:11 feremabraz

export const getSession = async (): Promise<Session | null> => { ... }

I don't see why Promise<Session | null> is required. Other than that...

export async function getSession() {
  try {
    return await unstable_getServerSession(authOptions)
  } catch (error) {
    return null
  }
}

...confirmed as a workaround.

Not required, I just have a hella strict linter setup 😅

haydenbleasel avatar Nov 29 '22 18:11 haydenbleasel

Not required, I just have a hella strict linter setup sweat_smile

Than you very much Hayden. Great work!

feremabraz avatar Nov 29 '22 19:11 feremabraz