Next.js Discord

Discord Forum

CSS nor JS are working on my nextjs static export

Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Open in Discord
Cuvier’s Dwarf CaimanOP
I don't know if I messed up during the build or anything but it's not supposed to look like this.

56 Replies

Cuvier’s Dwarf CaimanOP
it's supposed to look like this
Cuvier’s Dwarf CaimanOP
the actual version is hosted on vercel
@Ray how do you start the server?
Cuvier’s Dwarf CaimanOP
but the one without css is a static export
@Cuvier’s Dwarf Caiman but the one without css is a static export
the static export one is not on vercel?
@Ray the static export one is not on vercel?
Cuvier’s Dwarf CaimanOP
the 2nd image is on vercel
the 1st isn't
where does it host or how do you start the server?
@Ray where does it host or how do you start the server?
Cuvier’s Dwarf CaimanOP
I'm not sure, I paid someone to make me the nextjs app and I just host it on vercel, it does the job automatically
im kinda confused :lolsob:
Cuvier’s Dwarf CaimanOP
oh lol
so the first one is hosted on vercel or not? lol
@Cuvier’s Dwarf Caiman it's supposed to look like this
Cuvier’s Dwarf CaimanOP
vercel
so you have a folder with html, javascript and css in it?
or you have the source code that you can build?
Cuvier’s Dwarf CaimanOP
@Ray or you have the source code that you can build?
Cuvier’s Dwarf CaimanOP
I have the source code
ok do you want it to host at vercel?
Cuvier’s Dwarf CaimanOP
@Ray ok do you want it to host at vercel?
Cuvier’s Dwarf CaimanOP
no, I want to export it into a static website with html css and javascript
you just open the index.html in brower?
Cuvier’s Dwarf CaimanOP
yes
then you need to add a . to all the href
Cuvier’s Dwarf CaimanOP
I tried doing that
look
search for stylesheet
btw, the href of image also need a .
Cuvier’s Dwarf CaimanOP
alright
doesn't work
it use cdn
Cuvier’s Dwarf CaimanOP
what does it mean?
click that link
Cuvier’s Dwarf CaimanOP
alright
copy all the content and create a file in out/_next/static/css/fontawesome.min.css and paste it
btw where are you gonna host it?
@Ray btw where are you gonna host it?
Cuvier’s Dwarf CaimanOP
I'm not sure yet
still not working
idk why bro I'm sorry if I annoy you
but this is really important to me
@Cuvier’s Dwarf Caiman Click to see attachment
change the path here
to ./_next/static/css/fontawesome.min.css
btw you can just run npx serve@latest out
@Ray btw you can just run `npx serve@latest out`
Cuvier’s Dwarf CaimanOP
alright
@Ray to `./_next/static/css/fontawesome.min.css`
Cuvier’s Dwarf CaimanOP
still nothing
i don't know why it isn't working
it works on vercel though
ah if you run npx serve@latest out now, you should better rebuild first
copy the index.html to somewhere
so you don't have to change the path again lol