vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.56k stars 1.85k forks source link

Chapter 6: Error when deploying in Vercel #254

Closed lucasnantonio closed 10 months ago

lucasnantonio commented 10 months ago

App runs perfectly in localhost, but when deploying in Vercel I get:

Type error: Cannot find module '@/app/ui/fonts' or its corresponding type declarations.
--
17:25:29.880 |  
17:25:29.880 | 1 \| import { GlobeAltIcon } from '@heroicons/react/24/outline';
17:25:29.880 | > 2 \| import { lusitana } from '@/app/ui/fonts';
17:25:29.880 | \|                          ^
17:25:29.880 | 3 \|
17:25:29.880 | 4 \| export default function AcmeLogo() {
17:25:29.880 | 5 \|   return (
17:25:29.936 | Error: Command "npm run build" exited with 1

My repo: https://github.com/lucasnantonio/nexjs-learn-exercise

GeraAlcantara commented 10 months ago

243 ?

mrinmoyf2 commented 10 months ago

@GeraAlcantara

Create a file under the app/ui directory 'fonts.ts'.

import { Inter , Lusitana} from 'next/font/google'; export const inter = Inter({ subsets: ['latin'] }); export const lusitana = Lusitana({ weight: ['400', '700'], subsets: ['latin'], });

Then Deploy your project.