fair-rose
fair-rose9mo ago

getting 404 error when clicked on create button on refine client dashboard page add property

getting 404 error when clicked on create button on refine client dashboard page add property
2 Replies
kapa.ai
kapa.ai9mo ago
Hi @jakshire01. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- If you're getting a 404 error when clicking the create button on your refine client dashboard, it might be due to how your routing is set up. In Refine, when components are used to define the resource actions, default paths will be used. You can override the default paths by assigning an object with component and path properties to the action properties. The default paths are: - list: /resources - create: /resources/create - edit: /resources/edit/:id - show: /resources/show/:id If you're using a custom router like Next.js or Remix, you might need to set up a catch-all route to handle undefined routes. Here's an example for Next.js:
import { RefineRoutes } from "@refinedev/nextjs-router/app";

export default function CatchAll() {
return (
<RefineRoutes>
{(matchingRoute) => {
if (matchingRoute) {
return { matchingRoute };
}

return <ErrorPage />;
}}
</RefineRoutes>
);
}
import { RefineRoutes } from "@refinedev/nextjs-router/app";

export default function CatchAll() {
return (
<RefineRoutes>
{(matchingRoute) => {
if (matchingRoute) {
return { matchingRoute };
}

return <ErrorPage />;
}}
</RefineRoutes>
);
}
And here's an example for Remix:
import { RefineRoutes } from "@refinedev/remix-router";
import { RefineRoutes } from "@refinedev/remix-router";
Please ensure that you have defined the create action in your resources array. If you have already done this and you're still getting a 404 error, it might be due to your routing setup. For more information, you can refer to the source (https://discord.com/channels/837692625737613362/1142228537416368169). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@418995770205929473> kapa.ai is still learning and improving, please let us know how it did by reacting below