Next.js Discord

Discord Forum

NextJS deploy on vercel failed

Answered
Dutch Smoushond posted this in #help-forum
Open in Discord
Dutch SmoushondOP
Hi guys! Working on NextJS official tutorial, and deploy on vercel fails with some errors. Any idea how to fix it? Here is the log:
Running "pnpm run build"
> @ build /vercel/path0/nextjs-dashboard
> next build
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
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:
https://nextjs.org/telemetry
   ▲ Next.js 15.0.3
   Creating an optimized production build ...
 ✓ Compiled successfully
   Linting and checking validity of types ...
Failed to compile.
./app/ui/acme-logo.tsx:2:26
Type error: Cannot find module '@/app/ui/fonts' or its corresponding type declarations.
  1 | import { GlobeAltIcon } from '@heroicons/react/24/outline';
> 2 | import { lusitana } from '@/app/ui/fonts';
    |                          ^
  3 |
  4 | export default function AcmeLogo() {
  5 |   return (
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1

Any help would be highly appreciated!
Answered by Asian black bear
You haven't committed your fonts.ts file in the repo.
View full answer

36 Replies

Dutch SmoushondOP
Yes, locally it works fine
u didnt change the sconfig?
tsconfig*
Dutch SmoushondOP
Do you mean this one
{
  "compilerOptions": {
    "target": "ES2017",
    "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"
      }
    ],
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts",
    "app/lib/placeholder-data.ts",
    "scripts/seed.js"
  ],
  "exclude": ["node_modules"]
}

?
Didn't touch it
can u show me your project structure
take a screenshot
Dutch SmoushondOP
Sure. Thanks
looks fine?
weird
and vercel is building for nextjs?
Asian black bear
Have you, by any chance, pushed the ui folder or the fonts.ts file under a different name that only differs in casing such as UI or Fonts?
Followup question: can you show the contents of the ui folder on GitHub?
Dutch SmoushondOP
The all are lower case
Asian black bear
There is a difference of them being committed with a different casing but being used locally as lower/kebab case.
This is what I want to rule out with the screenshot from GitHub.
Asian black bear
It's private but no need to share. Just show me a screenshot of the ui folder's contents please.
Dutch SmoushondOP
I converted it to public
Just a sec
Asian black bear
You haven't committed your fonts.ts file in the repo.
Answer
Asian black bear
It's missing.
Dutch SmoushondOP
so weird...
Now I cannot add it to git tracking
Asian black bear
Are you sure you're committing to the correct repository or branch?
You linked the master branch but in your first screenshot on the bottom is shows main which is somehow indicative of you committing to the wrong branch.
So chances are you pushed to the wrong destination.
Dutch SmoushondOP
hhhhhh now I see
I'm so sorry
Thank you very much!
❤️