CANT GET THROUGH NEXTJS/LEARN
Unanswered
Archieπ posted this in #help-forum
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
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';
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 π¦
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
βββ 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.0react@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
β βββ @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.0react@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.
damn, worst side of this job ig like a mechanic in car repair, i should see it definitely π. I like reading logs
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'],
});
export const inter = Inter({ subsets: ['latin'] });
export const lusitana = Lusitana({
weight: ['400', '700'],
subsets: ['latin'],
});
@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
i agree. because it feels like your a pro coder until its time to code yourself π
@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 issueDutch
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
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={
>
<GlobeAltIcon className="h-12 w-12 rotate-[15deg]" />
<p className="text-[44px]">Acme</p>
</div>
);
}
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={
>
<GlobeAltIcon className="h-12 w-12 rotate-[15deg]" />
<p className="text-[44px]">Acme</p>
</div>
);
}
'''
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 therebtw 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
β² 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.
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.
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.
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/fontsbut you said
@ui/fonts didnt workyou 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
@Archieπ 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.
Ping me when you're free, I might be able to assist you
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 upIf 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 guessok 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 ?
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 ?
@Archieπ 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 ?
git add .
git commit -m "a message you want"
git push
@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';
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
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'
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 ?
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": {
"@": ["./"]
"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
run
git commit -am "some message"
git push origin main
@Anay-208 | Ping in replies <@1220020605181497397> I've already mentioned, you've not pushed your files to github.
run
bash
git commit -am "some message"
git push origin main
i have pushed everything to git now but it still doesnt work.
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
"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={
>
<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.
'''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
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''''''
β 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''''''