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
No description
K
kapa.ai196d ago
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:
// Using `loader`
// app/routes/$.tsx
import { json, LoaderFunction } from "@remix-run/node";

export const loader: LoaderFunction = async ({ params, request, context }) => {
return json({}, { status: 404 });
};

// Using `Authenticated`
// app/routes/$.tsx
import { Authenticated } from "@refinedev/core";

export default function NotFound() {
return (
<Authenticated>
<div>I'm the 404 page for the authenticated users.</div>
</Authenticated>
);
}
// Using `loader`
// app/routes/$.tsx
import { json, LoaderFunction } from "@remix-run/node";

export const loader: LoaderFunction = async ({ params, request, context }) => {
return json({}, { status: 404 });
};

// Using `Authenticated`
// app/routes/$.tsx
import { Authenticated } from "@refinedev/core";

export default function NotFound() {
return (
<Authenticated>
<div>I'm the 404 page for the authenticated users.</div>
</Authenticated>
);
}
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: ----------------------
K
kapa.ai196d ago
<@1104319194608193577> kapa.ai is still learning and improving, please let us know how it did by reacting below
R
ratty-blush195d ago
Didn't solve my problem. My question is why there is an error when deploying on Netlify. @kapa.ai
K
kapa.ai195d ago
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?
F
flat-fuchsia190d 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.
More Posts
useExport keeps fetchingwhy is my useExport keeps fetching even though it has passed the page limitHi all can anyone help me with solvingHi all, can anyone help me with solving this error: Uncaught ReferenceError: global is not defined Antd 4 Dark Mode not Working ProperlyI am trying to upgrade fully to Antd v4 in Refine v3 so I can then upgrade to Antd v5 and Refine v4.show on error notificiationwhile downloading some csv filehow to get :idevent/v1/event/:id/ticket-class/new/ how to get :id in the code, I want to create a ticket-class lisWill Refine integrate with Astro in the future?Considering to SSR / SSG I'm thinking using Next.js or Astro just wanna know, will Refine integratuseCustomcall useCustom manuallyuseFormcall a get api using useFormNestJs Data Providers Backend ExampleIs there repo for these examples in documentation using Nest CRUD or Nest Query as data providers? Tanstack router?Has anyone managed to use tanstack router with refine?Refine v3 Codemod for Antd v3 to v4?I am realizing I still have @pankod/refine-antd v3 and am trying to upgrade to v4... is there a codeRefine 3.x with Antd4 List.extra not appearing correctlyI am trying to update my Antd from 3.x to 4.x with Refine v3 and the page header extra is missing laMultiple Auth Provider in a single app. Possible?Hi everyone! A refine newbie here. First, a huge thanks to refine team for building something prettyKeep getting this error when installing refine and refine dev, been stuff for a while I need helpHow does DataProvider manage field types?I am working on a custom data provider, but for some reason, default template I got from refine playchakra ui formHi guys! I have a question, maybe a silly one but im not very experienced with react and just startihi there i have question about edit pagehi there i have question about edit page, API get detail data and patch have difference schema ex: `Hi there I want to build kind of aHi there, I want to build kind of a business middleware that will help me handle some administrative