Next.js Discord

Discord Forum

problem html to next.js

Answered
Red imported fire ant posted this in #help-forum
Open in Discord
Avatar
Red imported fire antOP
I have putting the js,scss,css,img,lib folders in the public folder my index works fine but other pages like about.js ,contact.js what do not work like index.js the problem I m having is that the css en scss lib etc works fine on my index.js but not on my about.js
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Answered by joulev
this is likely what happens:

* you use something like <link href="css/styles.css" />
* it works fine at / because /css/styles.css is found
* but it doesn't work at /about because /about/css/styles.css is not found

if this is indeed the bug, then add a / at the start, <link href="/css/styles.css" />
View full answer

9 Replies

Avatar
not-milo.tsx
are you mixing plain html and css with Next.js? and if you are, what's preventing you from completely switching to Next?
Avatar
European sprat
he's trying to port his existing HTML/CSS/JS site to next. i suggested starting from scratch because in other screenshots there's like 100 SCSS files, JS files, bootstrap static files, etc
i'd start from scratch and use some npm libraries to handle all the stuff
it is definitely possible to do it all yourself with your existing content but the amount of work will be very large and nothing anyone says here is going to be able to help with that task
Avatar
joulev
this is likely what happens:

* you use something like <link href="css/styles.css" />
* it works fine at / because /css/styles.css is found
* but it doesn't work at /about because /about/css/styles.css is not found

if this is indeed the bug, then add a / at the start, <link href="/css/styles.css" />
Answer
Avatar
Red imported fire antOP
Thank you i workd for mee!!
Thank you i workd for mee!!
Avatar
Red imported fire antOP
Thank you for helping !
Does anyone know how to make the contact form work? I am still working on the same project html to next.js.