I just created a next.js app then when I try linking another page, it is 404, I read that it is a bug, but I don’t know how to fix it. upon creating the app, I don’t have the pages folder, I wrote the link on page.js,
image of the folders, files after you create the app
import Link from 'next/link'
export default function Home() {
return (
<><><div>
<Link href='./about'>test</Link>
<Link href={'about'}>ABout</Link>
<a href='/about'>anchor tag</a>
</div>
</></>
)
}
what should i do to make it work? thanks
2
Answers
I've been saying yes to the src/ in the installation part. This solved my problem, I chose no to the 'src/' directory
Post your actual code here instead of screenshots if you want quicker and better answers.
For now, try adding a dot in front of your folder path and you have forgotten the extension in your file (.js). So the code should look like: