I am using Next.js 14.1.0 and encounter an issue with @supabase/ssr complaining ReferenceError: __dirname with middle.ts on deploment.
When I follow the article about using @supabase/ssr, everything works fine. However, after I deploy the app to Vercel, it says the app has crashed and ReferenceError: __dirname is not defined in the log.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Bug report
Describe the bug
I am using Next.js 14.1.0 and encounter an issue with @supabase/ssr complaining ReferenceError: __dirname with middle.ts on deploment.
When I follow the article about using @supabase/ssr, everything works fine. However, after I deploy the app to Vercel, it says the app has crashed and
ReferenceError: __dirname is not defined
in the log.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
Deployment on Vercel works fine without crashes.
Screenshots
System information
Additional context
Add any other context about the problem here.