Page Not Found when deployed in Netlify
Hi guys.
I’m having a 404 (Not Found) error when I’m trying to run the simple tutorial blog site
5 Replies
Hi @arsser.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In refine, handling 404 errors has changed in recent versions. Previously, if
authProvider
was defined, users were redirected to the /login
route even with 404s, and 404 pages were only available to authenticated users. Now, the routes are handled by the users, so you can handle the 404s however you like.
If you're using Remix, you can use a splat ($) route to handle the 404s. Here's an example of how to do it:
You can check out the remix docs (https://remix.run/docs/en/main/guides/routing#md-splats) for more information.
If you're using Next.js, you can create a 404.tsx
file in your /pages
directory and it will be used as the 404 page. For more information, you can check the Next.js documentation for custom 404 page (https://nextjs.org/docs/advanced-features/custom-error-page#404-page).
Sources:
- Remix 404 handling in refine (https://refine.dev/docs/packages/documentation/routers/remix/)
- Next.js 404 handling in refine (https://refine.dev/docs/packages/documentation/routers/nextjs/)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1104319194608193577> kapa.ai is still learning and improving, please let us know how it did by reacting below
stormy-goldOP•14mo ago
Didn't solve my problem. My question is why there is an error when deploying on Netlify.
@kapa.ai
Let me check the knowledge base for you. One moment! :books:
Sorry @arsser., I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
extended-salmon•14mo ago
Hello @arsser. you should check netlify deploy logs, generally make sure you run
npm run build
and see if it fails. Then you can start dev server from built app to check if there are any errors causing this.