vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.64k stars 26.83k forks source link

ERR_ABORTED 404 (Not Found) using Link in production #16313

Closed darwin-morocho closed 4 years ago

darwin-morocho commented 4 years ago

I am using next.js with typescript. I have a list of productos and I use Link to navigate to the detail page.

  <Link  href={`/curso/${item.path}`}>
              <a>
                <img className="w-100 banner" src={item.banner} alt={item.name} />
              </a>
            </Link>

When I make a click in the product the navigation to detail page works perfect in dev and production mode. But in the browser console I get an error 404 when the product list is rendered and a product is inside a Link. When I run in dev mode all is Ok but when I build the project with npm run build and run with npm start I have the next errors in the browser console (google chrome and mozilla, I am not sure in safari)

GET http://localhost:3000/_next/static/XQPCRyJ-ggEJHEIjhc5Lm/pages/curso/flutter-custom-clippers.js net::ERR_ABORTED 404 (Not Found)

these are my scripts inside my packgage.json

  "scripts": {
    "dev": "next -p 3000",
    "build": "next build",
    "start": "next start -p 3000"
  },
adenekan41 commented 4 years ago

@darwin-morocho did you account for the dynamic page in your next.js folder? like this

--- cursor
    --- [id].js
Timer commented 4 years ago

Please upgrade to next@^9.5.3-canary.8 which should fix this 404!

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.