Next.js Discord

Discord Forum

in production mode, i get an error in console

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
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.
it does not tell me in what parts of code i get the error, but some stackoverflow/github posts said it may be in server components that are fetching data, and i need to put fetch in trycatch block, which i did, but still get this error, if you would need some snippets of code, feel free to ask
Answered by Transvaal lion
@Ray i found out that i forgot to add .env go gitignore and so development variables messed up the production ones. Thanks for pointing to the issue. Helped me a lot
View full answer

34 Replies

Transvaal lionOP
you can also view the issue at https://yeh.lol/v and while registring at the /signup
hosting: vercel
i recently pushed some major changes to the code
before i could freely register, login etc and did not get this error
@Transvaal lion hosting: vercel
have you checked the log on vercel?
@Ray have you checked the log on vercel?
Transvaal lionOP
[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.] {
digest: '254759550'
}
also this
yes the error cause by the prisma query
@Ray yes the error cause by the prisma query
Transvaal lionOP
i see, thanks, ill try to fix it
@Ray yes the error cause by the prisma query
Transvaal lionOP
i have a question, can it possibly happen if an image does not have src,since i get this in development on /v
@Ray you mean the error?
Transvaal lionOP
yes
@Transvaal lion Click to see attachment
I don't think so, since the log is saying invalid prisma.user.findUnique()
I assume the source of the image is from the user object?
@Ray I assume the source of the image is from the user object?
Transvaal lionOP
it is from a third party API that fetches discord user by ID and returns an object with data like user pfp, name, status, activity image etc
this exact image is activity image
ok but I don't think the image error will cause a 500 internal error
@Transvaal lion Click to see attachment
this doesn't show what the error is?
@Ray this doesn't show what the error is?
Transvaal lionOP
it says that the error is in findUser function which works fine in the development mode, but error in production
PrismaClientInitializationError:
Invalid prisma.user.findUnique() invocation:


Error querying the database: ERROR: Console request failed: endpoint is temporary unavailable. check your quotas and/or contact our supportmirui
what database do you use
Transvaal lionOP
vercel postgres
are you connecting to vercel postgres on local too?
@Ray are you connecting to vercel postgres on local too?
Transvaal lionOP
yes
have you try next build && next start?
@Ray have you try `next build` && `next start`?
Transvaal lionOP
uncaughtException [Error: EPERM: operation not permitted, open 'C:\Users\u\Documents\GitHub\yeh.lol\.next\trace'] { errno: -4048, code: 'EPERM', syscall: 'open', path: 'C:\\Users\\u|\Documents\\GitHub\\yeh.lol\\.next\\trace' }
ill try npm run build
yes
@Ray yes
Transvaal lionOP
i just noticed that the issue is that in the deployment there are old env variables for db and cloudflare, ill update them right quick
Transvaal lionOP
@Ray i found out that i forgot to add .env go gitignore and so development variables messed up the production ones. Thanks for pointing to the issue. Helped me a lot
Answer