Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vercel Deployment Error: Module Not Found - Can't Resolve #69390

Closed
Paulolinks opened this issue Aug 28, 2024 · 2 comments
Closed

Vercel Deployment Error: Module Not Found - Can't Resolve #69390

Paulolinks opened this issue Aug 28, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@Paulolinks
Copy link

Link to the code that reproduces this issue

https://github.com/Paulolinks/cs_schedule.git

To Reproduce

I ran the build on my local machine, and it worked fine. However, when I try to deploy on Vercel, I encounter the error: "Module not found: Can't resolve."

It seems like Vercel is unable to find the RegisterForm component, even though it works fine on my local machine. I've already checked the file path and it appears to be correct. I suspect the issue might be related to Vercel's case-sensitive file system, but I'm not sure how to resolve it.

What could be causing this issue, and how can I fix it?

Local Machine
PS C:\Users\paulo\OneDrive\Área de Trabalho\Ultimo - App Schedule\healthcare> npm run build

carepulse@0.1.0 build
next build

▲ Next.js 14.2.3

  • Environments: .env.local

Creating an optimized production build ...
✓ Compiled successfully
Skipping validation of types
Skipping linting
✓ Collecting page data
✓ Generating static pages (5/5)
✓ Collecting build traces
✓ Finalizing page optimization

Route (app) Size First Load JS
┌ ƒ / 9.19 kB 291 kB
├ ○ /_not-found 875 B 88 kB
├ ○ /admin 19.4 kB 301 kB
├ ƒ /patients/[userId]/new-appointment 2.15 kB 277 kB
├ ƒ /patients/[userId]/new-appointment/success 185 B 99.3 kB
└ ƒ /patients/[userId]/register 12.1 kB 287 kB

  • First Load JS shared by all 87.2 kB
    ├ chunks/23-d35994626add566e.js 31.6 kB
    ├ chunks/fd9d1056-45778ae974c01455.js 53.6 kB
    └ other shared chunks (total) 1.92 kB

○ (Static) prerendered as static content
ƒ (Dynamic) server-rendered on demand


Vercel Deploy

Failed to compile.

./app/patients/[userId]/register/page.tsx

Module not found: Can't resolve '@/components/forms/RegisterForm'

https://nextjs.org/docs/messages/module-not-found

Build failed because of webpack errors

Error: Command "npm run build" exited with 1

Current vs. Expected behavior

What I Tried:

I double-checked the file path and import statement in page.tsx to ensure that the case matches exactly with the file name.

I verified that the RegisterForm component is in the correct directory (/components/forms/).

I ran the build locally using npm run build, and it completed successfully without any errors.

I checked my .gitignore file to ensure that nothing critical was being excluded that might cause the module not to be found during deployment.

What I Expected:

I expected the deployment on Vercel to build successfully, as it does on my local machine, without any issues finding the RegisterForm component.

Check the print image
errooo

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32615
  Available CPU cores: 12
Binaries:
  Node: 20.16.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.0-canary.132 // Latest available version is detected (15.0.0-canary.132).
  eslint-config-next: 0.2.4
  react: 19.0.0-rc-eb3ad065-20240822
  react-dom: 19.0.0-rc-eb3ad065-20240822
  typescript: 5.5.4
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

"I've updated everything and checked for case-sensitive issues in filenames and imports."

@Paulolinks Paulolinks added the bug Issue was opened via the bug report template. label Aug 28, 2024
@ztanner
Copy link
Member

ztanner commented Aug 28, 2024

Hi - your .vercelignore is excluding components/forms/RegisterForm.tsx for some reason: https://github.com/Paulolinks/cs_schedule/blob/58b0b8404958915535c463aafdd37a3bafb90bd6/.vercelignore#L4

Things that are added to .vercelignore aren't included as part of your Vercel deployment. Docs

@ztanner ztanner closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
@Paulolinks
Copy link
Author

Hi ztanner,
I deleted the .vercelignore but I still facing the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants