Next.js Discord

Discord Forum

issue deploying to vercel

Answered
Giant panda posted this in #help-forum
Open in Discord
Avatar
Giant pandaOP
hi guys,

when i build locally everything is fine, when i deploy to vercel, i get the following error
Image
Answered by linesofcode
Check the casing of the file names
View full answer

40 Replies

Avatar
do you have a tsconfig file, and if so can you post it here
Avatar
Giant pandaOP
just the @ sign
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}
Avatar
uhh so it is there... have you customized the build script somehow?
Avatar
Giant pandaOP
{
  "name": "nextjs",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "format": "prettier --write \"./{components,data,interfaces,lib,models,pages,public,styles,types,validations}/**/*.{ts,tsx,js,json,html,css}\"",
    "postbuild": "next-sitemap"
  },
  "dependencies": {
    "alymkarimg-react-search-box": "^3.9.0",
    "formidable": "^3.5.1",
    "moment": "^2.29.4",
    "mongoose": "^6.8.0",
    "next": "latest",
    "next-sitemap": "^3.1.32",
    "prettier": "^2.8.0",
    "react": "^18",
    "react-data-table-component": "^7.5.4",
    "react-datepicker": "^4.19.0",
    "react-dom": "^18",
    "react-range-slider-input": "^3.0.7",
    "react-select": "5",
    "react-toastify": "^9.1.3",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@types/formidable": "^3.4.3",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-datepicker": "^4.15.1",
    "@types/react-dom": "^18",
    "@typescript-eslint/eslint-plugin": "5.62.0",
    "@typescript-eslint/parser": "^5.62.0",
    "autoprefixer": "^10",
    "eslint": "^8.7.0",
    "eslint-config-next": "13.5.4",
    "postcss": "^8",
    "typescript": "^5"
  }
}
i changed prettier abit
Avatar
and you have:
/pages
/components
  /forms
    /JobUploadForm.tsx
/package.json
Avatar
Giant pandaOP
Image
Avatar
and inside your components folder
and whats your code for said file (like are you default export)
Avatar
Giant pandaOP
Image
yeah, i tried standard exports too
both resulted in the same error
Avatar
so something like export default function JobUploadForm() right
Avatar
Giant pandaOP
Image
Avatar
i meant in the component file, how does that look
Avatar
Giant pandaOP
export default JobUploadForm;
at present
Avatar
uhhhh this looks very normal
Avatar
Giant pandaOP
yeah
Avatar
and npm run build && npm run start on local device works?
vercel must be having issues 😭
Avatar
Giant pandaOP
Image
ah damn
im off for lunch then
Avatar
enjoy (sorry that i couldn't be of any assistance)
Avatar
Giant pandaOP
No worries, I’m pretty much out of them too
Thanks for your time!
Avatar
Hey
Avatar
Check the casing of the file names
Answer
Avatar
Between your file system
And what’s in GitHub
Avatar
ohh that is smart, windows can sometimes be nicer than linux
Avatar
Git can be case sensitive or case insensitive
Depending on the os and your config
Avatar
Giant pandaOP
Sure! Thanks, will do, I’ll brb
Avatar
Giant pandaOP
Nice, that was it, i changed Forms => forms
Avatar
lol one more thing added to my list of weirdness to check 🙂
Avatar
Nice!