You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
▲ Next.js 14.2.3
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
├ 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
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
Provide environment information
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."
The text was updated successfully, but these errors were encountered: