Module not found when building on vercel

I have a project that i am trying to deploy to Vercel but it encounters different not found modules errors which do not appear when building locally . I have checked for misspelled words or different casings but it all is the same . I am seriously stuck and i do not know what to do .

[11:48:36.459] Cloning github.com/TruthSeeker12/TruthSeeker (Branch: main, Commit: 8d7c854)
[11:48:36.706] Previous build caches not available
[11:48:36.994] Cloning completed: 535.000ms
[11:48:37.060] Found .vercelignore
[11:48:37.062] Removed 0 ignored files defined in .vercelignore
[11:48:37.238] Running build in Washington, D.C., USA (East) – iad1
[11:48:37.444] Running "vercel build"
[11:48:37.917] Vercel CLI 41.6.2
[11:48:38.489] Installing dependencies...
[11:48:41.656] npm warn deprecated yaeti@0.0.6: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
[11:48:42.352] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
[11:48:42.722] npm warn deprecated npmlog@5.0.1: This package is no longer supported.
[11:48:43.178] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
[11:48:43.900] npm warn deprecated gauge@3.0.2: This package is no longer supported.
[11:48:44.470] npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
[11:48:44.895] npm warn deprecated @supabase/auth-helpers-shared@0.7.0: This package is now deprecated - please use the @supabase/ssr package instead.
[11:48:45.596] npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
[11:48:45.597] npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
[11:48:45.693] npm warn deprecated @supabase/auth-helpers-nextjs@0.10.0: This package is now deprecated - please use the @supabase/ssr package instead.
[11:48:45.753] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
[11:48:48.970] npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
[11:48:58.350] 
[11:48:58.350] added 680 packages in 20s
[11:48:58.357] 
[11:48:58.357] 177 packages are looking for funding
[11:48:58.357]   run `npm fund` for details
[11:48:58.430] Detected Next.js version: 14.2.28
[11:48:58.435] Running "npm run build"
[11:48:58.575] 
[11:48:58.576] > truthseeker@0.1.0 build
[11:48:58.577] > next build
[11:48:58.577] 
[11:48:59.265] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[11:48:59.266] This information is used to shape Next.js' roadmap and prioritize features.
[11:48:59.266] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[11:48:59.267] https://nextjs.org/telemetry
[11:48:59.267] 
[11:48:59.336]   β–² Next.js 14.2.28
[11:48:59.337] 
[11:48:59.430]    Creating an optimized production build ...
[11:49:20.443] Failed to compile.
[11:49:20.444] 
[11:49:20.444] ./app/(auth)/auth/email-confirmed/page.tsx
[11:49:20.444] Module not found: Can't resolve '@/lib/auth-redirect'
[11:49:20.444] 
[11:49:20.444] https://nextjs.org/docs/messages/module-not-found
[11:49:20.444] 
[11:49:20.444] ./app/(auth)/auth/reset-password/page.tsx
[11:49:20.444] Module not found: Can't resolve '@/lib/supabase'
[11:49:20.444] 
[11:49:20.444] https://nextjs.org/docs/messages/module-not-found
[11:49:20.444] 
[11:49:20.444] ./app/(dashboard)/dashboard/layout.tsx
[11:49:20.445] Module not found: Can't resolve '@/client/lib/translations'
[11:49:20.445] 
[11:49:20.445] https://nextjs.org/docs/messages/module-not-found
[11:49:20.445] 
[11:49:20.445] ./app/(dashboard)/dashboard/layout.tsx
[11:49:20.445] Module not found: Can't resolve '@/lib/utils'
[11:49:20.445] 
[11:49:20.445] https://nextjs.org/docs/messages/module-not-found
[11:49:20.445] 
[11:49:20.445] ./app/debug-test/page.tsx
[11:49:20.445] Module not found: Can't resolve '@/lib/supabase'
[11:49:20.445] 
[11:49:20.445] https://nextjs.org/docs/messages/module-not-found
[11:49:20.445] 
[11:49:20.460] 
[11:49:20.460] > Build failed because of webpack errors
[11:49:20.491] Error: Command "npm run build" exited with 1
[11:49:21.397] 

these are the errors that pop up

this is tsconfig





I have already built it locally and it works as it should but on vercel this errors constantly appears even though i think i have checked all the required boxes . I have tried with env’s and without env’s and nothing happened .

Hi @truthseeker12, welcome to the Vercel Community!

What happens when you run vercel build from your CLI tool locally?

Also, can you confirm the Node version you are using locally vs the one used by Vercel (check Vercel project settings)?

v22.14.0 this is the version and i have run vercel build and it completed succesfully

  Creating an optimized production build ...
 βœ“ Compiled successfully
 βœ“ Linting and checking validity of types
   Collecting page data  .Supabase config: Running in production mode
Supabase config: Running in production mode
Supabase config: Running in production mode
Supabase config: Running in production mode
Supabase config: Running in production mode
Supabase config: Running in production mode
Supabase config: Running in production mode
 βœ“ Collecting page data
   Generating static pages (0/32)  [    ]Supabase config: Running in production mode
Supabase config: Running in production mode
 βœ“ Generating static pages (32/32)
 βœ“ Collecting build traces
 βœ“ Finalizing page optimization

Route (app)                                 Size     First Load JS
β”Œ Ζ’ /                                       142 B          87.4 kB
β”œ Ζ’ /_not-found                             873 B          88.1 kB
β”œ Ζ’ /api/articles/analyze                   0 B                0 B
β”œ Ζ’ /api/articles/check-transcript          0 B                0 B
β”œ Ζ’ /api/articles/detail/[id]               0 B                0 B
β”œ Ζ’ /api/articles/history                   0 B                0 B
β”œ Ζ’ /api/articles/history/[id]              0 B                0 B
β”œ Ζ’ /api/articles/update-conversation/[id]  0 B                0 B
β”œ Ζ’ /api/articles/upload-file               0 B                0 B
β”œ Ζ’ /api/auth/[...nextauth]                 0 B                0 B
β”œ Ζ’ /api/auth/callback                      0 B                0 B
β”œ Ζ’ /api/auth/resend-confirmation           0 B                0 B
β”œ Ζ’ /api/auth/send-verification             0 B                0 B
β”œ Ζ’ /api/auth/session                       0 B                0 B
β”œ Ζ’ /api/auth/signup                        0 B                0 B
β”œ Ζ’ /api/auth/verify                        0 B                0 B
β”œ Ζ’ /api/checkout                           0 B                0 B
β”œ Ζ’ /api/dashboard/recent-analysis          0 B                0 B
β”œ Ζ’ /api/dashboard/recent-figure            0 B                0 B
β”œ Ζ’ /api/dashboard/stats                    0 B                0 B
β”œ Ζ’ /api/dashboard/user-plan                0 B                0 B
β”œ Ζ’ /api/db-setup                           0 B                0 B
β”œ Ζ’ /api/debug-log                          0 B                0 B
β”œ Ζ’ /api/political-figures                  0 B                0 B
β”œ Ζ’ /api/political-figures/force-real       0 B                0 B
β”œ Ζ’ /api/subscriptions                      0 B                0 B
β”œ Ζ’ /api/subscriptions/cancel               0 B                0 B
β”œ Ζ’ /api/subscriptions/update-payment       0 B                0 B
β”œ Ζ’ /api/transcribe/submit                  0 B                0 B
β”œ Ζ’ /api/user/change-password               0 B                0 B
β”œ Ζ’ /api/user/profile                       0 B                0 B
β”œ Ζ’ /api/user/settings                      0 B                0 B
β”œ Ζ’ /api/user/usage                         0 B                0 B
β”œ Ζ’ /api/webhooks/stripe                    0 B                0 B
β”œ Ζ’ /auth                                   9.46 kB         236 kB
β”œ Ζ’ /auth/email-confirmed                   3.66 kB         170 kB
β”œ Ζ’ /auth/reset-password                    5.9 kB          196 kB
β”œ Ζ’ /auth/verify                            472 B          87.7 kB
β”œ Ζ’ /contact                                7.63 kB         159 kB
β”œ Ζ’ /dashboard                              9.92 kB         222 kB
β”œ Ζ’ /dashboard/article-analysis             23.1 kB         252 kB
β”œ Ζ’ /dashboard/browser-extension            417 B           124 kB
β”œ Ζ’ /dashboard/political-figures            10.4 kB         223 kB
β”œ Ζ’ /dashboard/settings                     11 kB           217 kB
β”œ Ζ’ /debug-test                             1.19 kB         123 kB
β”œ Ζ’ /debug/auth                             4.27 kB         161 kB
β”œ Ζ’ /privacy                                4.97 kB         148 kB
β”œ Ζ’ /site                                   7.76 kB         219 kB
β”œ Ζ’ /terms                                  4.86 kB         148 kB
β”” Ζ’ /test-supabase                          142 B          87.4 kB
+ First Load JS shared by all               87.2 kB
  β”œ chunks/117-aeeac95cda7ba865.js          31.6 kB
  β”œ chunks/fd9d1056-d6ae5370875315b7.js     53.6 kB
  β”” other shared chunks (total)             2 kB


Ζ’ Middleware                                59.2 kB

Ζ’  (Dynamic)  server-rendered on demand

Traced Next.js server files in: 184.394ms
Tracing entries due to missing build traces:
[
  "D:/TruthSeeker/.next/server/app/_not-found/page.js",
  "D:/TruthSeeker/.next/server/app/(auth)/auth/email-confirmed/page.js",
  "D:/TruthSeeker/.next/server/app/(site)/privacy/page.js",
  "D:/TruthSeeker/.next/server/app/(site)/contact/page.js",
  "D:/TruthSeeker/.next/server/app/(site)/site/page.js",
  "D:/TruthSeeker/.next/server/app/(site)/terms/page.js",
  "D:/TruthSeeker/.next/server/app/debug-test/page.js",
  "D:/TruthSeeker/.next/server/app/debug/auth/page.js",
  "D:/TruthSeeker/.next/server/app/auth/verify/page.js",
  "D:/TruthSeeker/.next/server/app/(auth)/auth/page.js",
  "D:/TruthSeeker/.next/server/app/(auth)/auth/reset-password/page.js",
  "D:/TruthSeeker/.next/server/app/test-supabase/page.js",
  "D:/TruthSeeker/.next/server/app/(dashboard)/dashboard/browser-extension/page.js",
  "D:/TruthSeeker/.next/server/app/(dashboard)/dashboard/page.js",
  "D:/TruthSeeker/.next/server/app/(dashboard)/dashboard/article-analysis/page.js",
  "D:/TruthSeeker/.next/server/app/(dashboard)/dashboard/political-figures/page.js",
  "D:/TruthSeeker/.next/server/app/(dashboard)/dashboard/settings/page.js",
  "D:/TruthSeeker/.next/server/app/api/auth/[...nextauth]/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/callback/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/resend-confirmation/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/send-verification/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/signup/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/verify/route.js",
  "D:/TruthSeeker/.next/server/app/api/checkout/route.js",
  "D:/TruthSeeker/.next/server/app/api/dashboard/user-plan/route.js",
  "D:/TruthSeeker/.next/server/app/api/subscriptions/cancel/route.js",
  "D:/TruthSeeker/.next/server/app/api/subscriptions/route.js",
  "D:/TruthSeeker/.next/server/app/api/subscriptions/update-payment/route.js",
  "D:/TruthSeeker/.next/server/app/api/user/change-password/route.js",
  "D:/TruthSeeker/.next/server/app/api/user/profile/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/history/[id]/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/update-conversation/[id]/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/check-transcript/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/detail/[id]/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/upload-file/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/history/route.js",
  "D:/TruthSeeker/.next/server/app/api/auth/session/route.js",
  "D:/TruthSeeker/.next/server/app/api/dashboard/stats/route.js",
  "D:/TruthSeeker/.next/server/app/api/articles/analyze/route.js",
  "D:/TruthSeeker/.next/server/app/api/dashboard/recent-analysis/route.js",
  "D:/TruthSeeker/.next/server/app/api/dashboard/recent-figure/route.js",
  "D:/TruthSeeker/.next/server/app/api/db-setup/route.js",
  "D:/TruthSeeker/.next/server/app/api/debug-log/route.js",
  "D:/TruthSeeker/.next/server/app/api/political-figures/force-real/route.js",
  "D:/TruthSeeker/.next/server/app/api/political-figures/route.js",
  "D:/TruthSeeker/.next/server/app/api/transcribe/submit/route.js",
  "D:/TruthSeeker/.next/server/app/api/user/usage/route.js",
  "D:/TruthSeeker/.next/server/app/api/user/settings/route.js",
  "D:/TruthSeeker/.next/server/app/api/webhooks/stripe/route.js"
]: 1.425s
Created all serverless functions in: 1.653s
Collected static files (public/, static/, .next/static): 7.869ms
βœ…  Build Completed in .vercel\output [40s]

Hey @truthseeker12 I took at look at your logs and my guess is that your .gitignore has lib as well as the other folders in there and are not actually committing to source control.

1 Like