vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.83k stars 1.19k forks source link

Issue deploying to vercel. #221

Open JCichocki opened 1 year ago

JCichocki commented 1 year ago

When I attempt to deploy this to vercel, the build is failing with the following errors:

Route (app) Size First Load JS

12:11:14.963 | ┌ λ / 5.32 kB 84.9 kB 12:11:14.963 | ├ λ /account 3.11 kB 88.4 kB 12:11:14.963 | ├ λ /api/create-checkout-session 0 B 0 B 12:11:14.964 | ├ λ /api/create-portal-link 0 B 0 B 12:11:14.964 | ├ λ /api/webhooks 0 B 0 B 12:11:14.964 | ├ λ /auth/callback 0 B 0 B 12:11:14.964 | └ λ /signin 21.1 kB 129 kB 12:11:14.964 | + First Load JS shared by all 79.6 kB 12:11:14.965 | ├ chunks/810-b9235b348c6a4427.js 24.9 kB 12:11:14.965 | ├ chunks/d596c951-bbc7c11c24bddf18.js 52.7 kB 12:11:14.965 | ├ chunks/main-app-2120efdc862394fb.js 211 B 12:11:14.965 | └ chunks/webpack-d3aa3aa7a8afd2d9.js 1.78 kB 12:11:14.965 |   12:11:14.965 | Route (pages) Size First Load JS 12:11:14.965 | ─ ○ /404 178 B 86.4 kB 12:11:14.965 | + First Load JS shared by all 86.2 kB 12:11:14.965 | ├ chunks/main-af8a46e9efa531e6.js 84.2 kB 12:11:14.965 | ├ chunks/pages/_app-db08ebc8c72074e8.js 192 B 12:11:14.965 | └ chunks/webpack-d3aa3aa7a8afd2d9.js 1.78 kB 12:11:14.966 |   12:11:14.966 | ƒ Middleware 101 kB 12:11:14.966 |   12:11:14.966 | λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps) 12:11:14.966 | ○ (Static) automatically rendered as static HTML (uses no initial props) 12:11:14.966 |   12:11:15.894 | Using TypeScript 5.0.4 (local user-provided) 12:11:18.350 | middleware.ts(10,23): error TS2339: Property 'getSession' does not exist on type 'SupabaseAuthClient'. 12:11:18.351 |   12:11:20.228 | Build Completed in /vercel/output [52s] 12:11:20.412 | Deploying outputs... 12:11:22.270 | Error: The Edge Function "middleware" is referencing unsupported modules: 12:11:22.270 | - next: stream, fs, url

This is then preventing the build from completing.

chriscarrollsmith commented 7 months ago

Go to Vercel, click "..." button beside your project and click "Settings". Under "Build & Development Settings" change "Framework Preset" from Others to Next.js. Should resolve your issue.