Next.js Discord

Discord Forum

img src not working when the img is under a folder for example /img/image.png

Answered
Korean bullhead posted this in #help-forum
Open in Discord
Korean bullheadOP
<img
className="rounded-md"
src="/zoe.png"
alt="PICTURE"
height="720"
width="920"
/>
this works but not
<img
className="rounded-md"
src="/img/zoe.png"
alt="PICTURE"
height="720"
width="920"
/>
both paths are correct!
Answered by Korean bullhead
i just opened the github repo and realized i forgot to push my changes 💀
View full answer

80 Replies

Korean bullheadOP
i fixed this by posting the imgs on public folder and doing /zoe.png
now got a diff prob
i cant deploy my site into vercel
i did all the steps
but when i open it
its just the default
wait
Korean bullheadOP
page
use next/image
and then put image in src/_images or a similiar folder
and import them
Korean bullheadOP
i fixed the image issue
Korean bullheadOP
can u help with the deploy one?
Korean bullheadOP
look
whats the error
Korean bullheadOP
it deployed but its not showing me the website just the default template
the github repo has my web page i imported from there
from the repo?
Korean bullheadOP
yea
go there
and select your repo
Korean bullheadOP
i did that
and import the repo
Korean bullheadOP
when its done
it just goes back
to the default one
the default template
can you send your folder structure
Korean bullheadOP
ok
whats the contents of /src/app/page.tsx
Korean bullheadOP
can you run next build
on your local machine
and then run next start
Korean bullheadOP
ok
and see what appears
Korean bullheadOP
..
npm run dev works tho
@Korean bullhead ..
try npx next build
Korean bullheadOP
doing
PS C:\Users\Razyexe\Desktop\zoe\zoe> npx run next build
Need to install the following packages:
run@1.5.0
Ok to proceed? (y) y

Watching C:\Users\Razyexe\Desktop\zoe\zoe and all sub-directories not excluded by your .gitignore. Will not monitor dotfiles.
Found & ignored ./node_modules ; is listed in .gitignore
Found & ignored ./next-env.d.ts ; is listed in .gitignore
Found & ignored ./src\app\globals.css ; has ignored extension

Starting: next build
node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module 'C:\Users\Razyexe\Desktop\zoe\zoe\next'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v20.14.0
@!=tgt
Korean bullheadOP
OH
mb
done
running next start
done
@!=tgt
its working good
ok weird
and send me a screenshot
Korean bullheadOP
the repo is the top zoe
@Korean bullhead Click to see attachment
ok click the import button here
Korean bullheadOP
ok
and send a screenshot of the next step
Korean bullheadOP
@!=tgt
Korean bullheadOP
@!=tgt yo you here?
click deploy
Korean bullheadOP
done
deploying
done
same issue
@!=tgt
@Korean bullhead can you send the screenshot of the entire project page
Korean bullheadOP
i just opened the github repo and realized i forgot to push my changes 💀
Answer
Korean bullheadOP
its workin now
sorry