Next.js Discord

Discord Forum

Cannot read properties of undefined (reading 'match')

Unanswered
kassq posted this in #help-forum
Open in Discord
Any ideas why my nextjs project builds locally but I receive this in github action? I mean it builds fine locally with docker as well.

Src to the payment route just in case: https://github.com/luuppiry/luuppi-next/blob/dev/next/src/app/api/payment/route.ts

#16 47.21 TypeError: Cannot read properties of undefined (reading 'match')
#16 47.21 at nv (/app/.next/server/app/api/payment/route.js:1:18081)
#16 47.21 at nA (/app/.next/server/app/api/payment/route.js:1:18182)
#16 47.21 at nS (/app/.next/server/app/api/payment/route.js:1:18643)
#16 47.21 at new ss (/app/.next/server/app/api/payment/route.js:7:13701)
#16 47.21 at 34563 (/app/.next/server/app/api/payment/route.js:9:372)
#16 47.21 at t (/app/.next/server/webpack-runtime.js:1:128)
#16 47.21 at n (/app/.next/server/app/api/payment/route.js:15:329630)
#16 47.21 at /app/.next/server/app/api/payment/route.js:15:329668
#16 47.21 at t.X (/app/.next/server/webpack-runtime.js:1:1206)
#16 47.21 at /app/.next/server/app/api/payment/route.js:15:329643

2 Replies

Fixed this by moving email client initialization inside the route logic
If someone has insight why this was the fix please tell me