Next.js Discord

Discord Forum

CANT GET THROUGH NEXTJS/LEARN

Unanswered
ArchieπŸ‘‘ posted this in #help-forum
Open in Discord
ive tried over 5 times now. definitley following instructions correctly. keep getting the same build fail logs repeatedly.

new to coding, use to just playing around with ai to see what i can build but wanted to learn next.js to bring my ideas to life. cant get over this hump. i know its the issue is definitley on my side i just dont know how to over come it.

if someone can take 5-10 minw to talk me through it ill be eternally grateful.

@Giant Schnauzer @Masai Lion @Anay-208 | Ping in replies

77 Replies

bro so many issues its so hard when there isnt someone there to help you. like admin for example. by the time someone replies the issue is completely different.
because i got past the old issue for example.

now my build is loading locally but never deploys on vercel

these are the errors

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 (
Static worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1

i have started again like 20 times now. so annoying 😦
β”œβ”€β”€ README.md
β”œβ”€β”€ app
β”‚ β”œβ”€β”€ dashboard
β”‚ β”‚ β”œβ”€β”€ customers
β”‚ β”‚ β”‚ └── page.tsx
β”‚ β”‚ β”œβ”€β”€ invoices
β”‚ β”‚ β”‚ └── page.tsx
β”‚ β”‚ β”œβ”€β”€ layout.tsx
β”‚ β”‚ └── page.tsx
β”‚ β”œβ”€β”€ layout.tsx
β”‚ β”œβ”€β”€ lib
β”‚ β”‚ β”œβ”€β”€ data.ts
β”‚ β”‚ β”œβ”€β”€ definitions.ts
β”‚ β”‚ β”œβ”€β”€ placeholder-data.ts
β”‚ β”‚ └── utils.ts
β”‚ β”œβ”€β”€ page.tsx
β”‚ β”œβ”€β”€ query
β”‚ β”‚ └── route.ts
β”‚ β”œβ”€β”€ seed
β”‚ β”‚ └── route.ts
β”‚ └── ui
β”‚ β”œβ”€β”€ acme-logo.tsx
β”‚ β”œβ”€β”€ button.tsx
β”‚ β”œβ”€β”€ customers
β”‚ β”‚ └── table.tsx
β”‚ β”œβ”€β”€ dashboard
β”‚ β”‚ β”œβ”€β”€ cards.tsx
β”‚ β”‚ β”œβ”€β”€ latest-invoices.tsx
β”‚ β”‚ β”œβ”€β”€ nav-links.tsx
β”‚ β”‚ β”œβ”€β”€ revenue-chart.tsx
β”‚ β”‚ └── sidenav.tsx
β”‚ β”œβ”€β”€ fonts.ts
β”‚ β”œβ”€β”€ global.css
β”‚ β”œβ”€β”€ home.module.css
β”‚ β”œβ”€β”€ invoices
β”‚ β”‚ β”œβ”€β”€ breadcrumbs.tsx
β”‚ β”‚ β”œβ”€β”€ buttons.tsx
β”‚ β”‚ β”œβ”€β”€ create-form.tsx
β”‚ β”‚ β”œβ”€β”€ edit-form.tsx
β”‚ β”‚ β”œβ”€β”€ pagination.tsx
β”‚ β”‚ β”œβ”€β”€ status.tsx
β”‚ β”‚ └── table.tsx
β”‚ β”œβ”€β”€ login-form.tsx
β”‚ β”œβ”€β”€ search.tsx
β”‚ └── skeletons.tsx
β”œβ”€β”€ next-env.d.ts
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ node_modules
β”‚ β”œβ”€β”€ @heroicons
β”‚ β”‚ └── react -> ../.pnpm/@heroicons+react@2.2.0_react@19.0.0/node_modules/@heroicons/react
β”‚ β”œβ”€β”€ @tailwindcss
β”‚ β”‚ └── forms -> ../.pnpm/@tailwindcss+forms@0.5.10_tailwindcss@3.4.17/node_modules/@tailwindcss/forms
β”‚ β”œβ”€β”€ @types
β”‚ β”‚ β”œβ”€β”€ bcrypt -> ../.pnpm/@types+bcrypt@5.0.2/node_modules/@types/bcrypt
β”‚ β”‚ β”œβ”€β”€ node -> ../.pnpm/@types+node@22.10.7/node_modules/@types/node
β”‚ β”‚ β”œβ”€β”€ react -> ../.pnpm/@types+react@19.0.7/nodemodules/@types/react
β”‚ β”‚ └── react-dom -> ../.pnpm/@types+react-dom@19.0.3
@types+react@19.0.7/node_modules/@types/react-dom
β”‚ β”œβ”€β”€ autoprefixer -> .pnpm/autoprefixer@10.4.20_postcss@8.5.1/node_modules/autoprefixer
β”‚ β”œβ”€β”€ bcrypt -> .pnpm/bcrypt@5.1.1/node_modules/bcrypt
β”‚ β”œβ”€β”€ clsx -> .pnpm/clsx@2.1.1/node_modules/clsx
β”‚ β”œβ”€β”€ next -> .pnpm/next@15.1.6_react-dom@19.0.0_react@19.0.0react@19.0.0/node_modules/next
β”‚ β”œβ”€β”€ next-auth -> .pnpm/next-auth@5.0.0-beta.25_next@15.1.6_react-dom@19.0.0_react@19.0.0
react@19.0.0__react@19.0.0/node_modules/next-auth
β”‚ β”œβ”€β”€ postcss -> .pnpm/postcss@8.5.1/node_modules/postcss
β”‚ β”œβ”€β”€ postgres -> .pnpm/postgres@3.4.5/node_modules/postgres
β”‚ β”œβ”€β”€ react -> .pnpm/react@19.0.0/node_modules/react
β”‚ β”œβ”€β”€ react-dom -> .pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom
β”‚ β”œβ”€β”€ tailwindcss -> .pnpm/tailwindcss@3.4.17/node_modules/tailwindcss
β”‚ β”œβ”€β”€ typescript -> .pnpm/typescript@5.7.3/node_modules/typescript
β”‚ β”œβ”€β”€ use-debounce -> .pnpm/use-debounce@10.0.4_react@19.0.0/node_modules/use-debounce
β”‚ └── zod -> .pnpm/zod@3.24.1/node_modules/zod
β”œβ”€β”€ package.json
β”œβ”€β”€ pnpm-lock.yaml
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ public
β”‚ β”œβ”€β”€ customers
β”‚ β”‚ β”œβ”€β”€ amy-burns.png
β”‚ β”‚ β”œβ”€β”€ balazs-orban.png
β”‚ β”‚ β”œβ”€β”€ delba-de-oliveira.png
β”‚ β”‚ β”œβ”€β”€ evil-rabbit.png
β”‚ β”‚ β”œβ”€β”€ lee-robinson.png
β”‚ β”‚ └── michael-novotny.png
β”‚ β”œβ”€β”€ favicon.ico
β”‚ β”œβ”€β”€ hero-desktop.png
β”‚ β”œβ”€β”€ hero-mobile.png
β”‚ └── opengraph-image.png
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json
did you guys have similar issues? it must be an issue on my side.
this is my issue. no matter how many times i start again and again. i get to step 6 and the website doesnt deploy on vercel. im not sure why i follow the instructions precisely. i think maybe i have conflicting files or downloads from old projects i am working on im not to sure.
this is my current screen on vercel
because im so used to just asking ai to fix my issues. as a beginer coder i have no experience working with like smaller instructions for example with next.js. i know its for people with experience but the only way to get experience is hands on for me
@ArchieπŸ‘‘ because im so used to just asking ai to fix my issues. as a beginer coder i have no experience working with like smaller instructions for example with next.js. i know its for people with experience but the only way to get experience is hands on for me
Dutch
a suggestion from friend: never use ai as beginner. i used it for a project which i dont know anything, and it generated me tons of redundant code which dont even work properly
share your fonts.ts
import { Inter, Lusitana } from 'next/font/google';

export const inter = Inter({ subsets: ['latin'] });

export const lusitana = Lusitana({
weight: ['400', '700'],
subsets: ['latin'],
});
@ArchieπŸ‘‘ i agree. because it feels like your a pro coder until its time to code yourself πŸ˜‚
Dutch
yea its just making things faster and more error prone ig
looks like your problem is not your fonts btw
Can you try @/ui/fonts as import path, I don't think it should work, but I'm unsure what else could solve this issue
Dutch
just remove that file and cut contents into root-layout file
That is a alternate solution, but doesn't solve the isssue
How are you deploying the app, like via github
ok so instead of this . do you guys know how i can like reset everything so theres no trace of any old files or installs ect ?

and yes new repo on github and then deploying via vercel. the @ui/fonts didnt work
Dutch
also can you share that app/ui/acme-logo file
import { GlobeAltIcon } from '@heroicons/react/24/outline';
import { lusitana } from '@/app/ui/fonts';

export default function AcmeLogo() {
return (
<div
className={${lusitana.className} flex flex-row items-center leading-none text-white}
>
<GlobeAltIcon className="h-12 w-12 rotate-[15deg]" />
<p className="text-[44px]">Acme</p>
</div>
);
}
'''import { GlobeAltIcon } from '@heroicons/react/24/outline';
import { lusitana } from '@/app/ui/fonts';

export default function AcmeLogo() {
return (
<div
className={${lusitana.className} flex flex-row items-center leading-none text-white}
>
<GlobeAltIcon className="h-12 w-12 rotate-[15deg]" />
<p className="text-[44px]">Acme</p>
</div>
);
}
'''
Dutch
import { lusitana } from '@/app/ui/fonts'; what it shows when you write @/ at there
btw i meant share screen as live
no i dont know how to share screen? do u know how?

and this is what message i get when i run the build locally

archiecope@archies-MacBook-Pro nextjs-dashboard % pnpm run build

@ build /Users/archiecope/nextjs-dashboard
next build

β–² Next.js 15.1.6
- Environments: .env

Creating an optimized production build ...
βœ“ Compiled successfully
βœ“ Linting and checking validity of types
βœ“ Collecting page data
βœ“ Generating static pages (9/9)
βœ“ Collecting build traces
βœ“ Finalizing page optimization

Route (app) Size First Load JS
β”Œ β—‹ / 5.49 kB 114 kB
β”œ β—‹ /_not-found 977 B 106 kB
β”œ β—‹ /dashboard 146 B 105 kB
β”œ β—‹ /dashboard/customers 146 B 105 kB
β”œ β—‹ /dashboard/invoices 146 B 105 kB
β”œ Ζ’ /query 146 B 105 kB
β”” Ζ’ /seed 146 B 105 kB
+ First Load JS shared by all 105 kB
β”œ chunks/59-28f7826bb891b4e3.js 50.5 kB
β”œ chunks/aec749e8-ff8989dc528ab614.js 52.9 kB
β”” other shared chunks (total) 1.92 kB


β—‹ (Static) prerendered as static content
Ζ’ (Dynamic) server-rendered on demand

archiecope@archies-MacBook-Pro nextjs-dashboard %

this means it builds right? so the problem must be like the link between github/vercel? im not sure.
hopefully this works
i will be in gym now for maybe 30 minutes i just finished work. hopefully you guys have some time afterwards to go through it i didnt realise we could share, terminals also which is good.

i will message here when i am back but in the mean time if you see anything i started a shared terminal just incase you do like spot any error.
Blood cockle
the problem is you cant find the file. so it's probably your routing. note that the suggestion was to try
@/ui/fonts
but you said
@ui/fonts didnt work
you know @/ui is different than @ui right?
Blood cockle
@ is a shortcut you can set in nextjs to refer to a specific folder. people here are trying to help you figure out which folder you have the shortcut "@" set to so you can find the path to your font file from there
Blood cockle
in your jsconfig or tsconfig file, there should be an option called "paths". copy paste that here along with your file structure to your fonts file and it should be easy from there
something like
"paths": {
   "@/*": ["./*"]
}
@Anay-208 | Ping in replies Ping me when you're free, I might be able to assist you
Dutch
me too, cuz says session timed out
@ArchieπŸ‘‘ Click to see attachment
the green color of file name along with U at the end means you didn't push this file to git(hub/lab), you need to push it first for vercel to pick it up
If it builds locally but doesn’t build in vercel
This is a file naming case sensitivity issue
Delete the file. Commit it to git.
Then recreate the file. Commit it to git.
Then deploy
If you look at GitHub I bet that icons file has an upper case letter in it
But on your file system it doesn’t
Blood cockle
i think it's a problem with his @ path config because in the screenshot, his acme-logo.tsx was found from a relative path "./app/ui/acme-logo.tsx" but errors on the @ in the next line and he said ai wrote this, so it might have assumed an existing folder structure, so the config file might not be set up
No, its not pushed to github actually. @/app/ui/fonts.ts Is correct I guess
ok so i have alot of green files so they are not pushed to git so that explains why it builds locally.
fonts ts is in app/ui/fonts.ts

but can you guys explain how to push the other files to git?

my 'paths' is


"paths": {
"@/": ["./"]


but maybe if i do push all the greeen files to git that may be the issue ?
@Yi Lon Ma bash git add . git commit -m "a message you want" git push
ok so i still get this error on vercel

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 (
Static worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
shall i change it to '@/app/ui/fonts.ts'?

its currently

'@/app/ui/fonts'
@linesofcode If you look at GitHub I bet that icons file has an upper case letter in it
i also checked this but it isnt uppercase

so do you mean delete the file from git, then re add it or

delete fonts.ts and re add that and then recommit it ?
i deleted and re added the file but still get the same error
shall i try to change the path to

"paths": {
"@": ["./"]
so i changed the paths to the above and it still gives the exact same error. i also changed the path in acme to match but still same error? do i clear the cache or somthing ?
@Blood cockle something like "paths": { "@/*": ["./*"] }
Blood cockle
why not try this exactly?
these are all different:
"@"
"@/"
"@/*"
you can also try removing the @ alias entirely and jsut manually give it a relative path from your current file to bypass this whole issue for now
@ArchieπŸ‘‘ I've already mentioned, you've not pushed your files to github.
run
git commit -am "some message"
git push origin main
so just to be clear i want to make three attempts to change

"paths": {
"@": ["./"]

"paths": {
"@/": ["./"]

"paths": {
"@/*": ["./"]

right ? and adjust in acme tsx

will give them a try
@Blood cockle these are all different: "@" "@/" "@/*"
when i change the paths the text in the other files goes red. has no effect on the build atm 😦 , how can i remove the @ entirely.? i will check the link.
changed my acme tsx too

'''import { GlobeAltIcon } from '@heroicons/react/24/outline';
import { lusitana } from app/ui/fonts

export default function AcmeLogo() {
return (
<div
className={${lusitana.className} flex flex-row items-center leading-none text-white}
>
<GlobeAltIcon className="h-12 w-12 rotate-[15deg]" />
<p className="text-[44px]">Acme</p>
</div>
);
}
'''

added the image of my tsconfig. im sure i aplplied the paths in the correct section like they asked.

still gives me the exact same error on vercel build.
im just going to start everything again. ill try a different code writer, any advice ??
ok so now i am passed this finally
but i have another issue
https://nextjs.org/learn/dashboard-app/setting-up-your-database

i am on the last part where i had to 'uncomment the file"

but when i remove im left with

'''import postgres from 'postgres';

const sql = postgres(process.env.POSTGRES_URL!, { ssl: 'require' });

async function listInvoices() {
const data = await sql`

SELECT invoices.amount, customers.name
FROM invoices
JOIN customers ON invoices.customer_id = customers.id
WHERE invoices.amount = 666;
}

return data;

'''


so im not sure if i removed too much from the file
console logs are


βœ“ Compiled /query in 91ms
'''''' β¨― ./app/query/route.ts:17:1
Parsing ecmascript source code failed
15 | }
16 |
17 |
| ^

Unexpected eof


βœ“ Compiled /_error in 396ms
GET /query 500 in 543ms''''''