R
Refine

ask-any-question

AntdInferencer not working

Jjolly-crimson9/18/2023
I'm trying to use AntdInferencer when create but it keep showing loading button
</Route>
<Route path="keys">
<Route index element={<KeyList />} />
<Route path="create" element={<AntdInferencer />} />
<Route path="show/:id" element={<AntdInferencer />} />
</Route>
</Route>
<Route path="keys">
<Route index element={<KeyList />} />
<Route path="create" element={<AntdInferencer />} />
<Route path="show/:id" element={<AntdInferencer />} />
</Route>
{
name: "admin/keys",
list: "admin/keys",
create: "/admin/keys/create",
show: "/admin/keys/show/:id",
meta: {
label: "Keys",
canDelete: true,
icon: <KeyOutlined />,
},
},
{
name: "admin/keys",
list: "admin/keys",
create: "/admin/keys/create",
show: "/admin/keys/show/:id",
meta: {
label: "Keys",
canDelete: true,
icon: <KeyOutlined />,
},
},
Kkapa.ai9/18/2023
Hi @tads8799. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the provided extracts, it seems like you're correctly using the AntdInferencer component for the create route. However, the extracts don't provide information about why the loading button keeps showing. The loading state might be due to the data provider taking time to fetch the data or an issue with the API endpoint. It's also possible that there's an error in your code that's not covered in the extracts. Unfortunately, without more information or context, it's hard to provide a definitive solution. I would recommend checking your network tab in the developer tools to see if there's an issue with the API request. Also, ensure that your data provider is set up correctly. For more information, you can refer to the Inferencer documentation (https://refine.dev/docs/packages/documentation/inferencer/). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai9/18/2023
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
Jjolly-crimson9/19/2023
API is not called at all @kapa.ai
Kkapa.ai9/19/2023
Let me check the knowledge base for you. One moment! :books: ---------------------- If the API is not being called at all, there could be several reasons for this. Here are a few things you can check based on the information provided in the extracts: 1. Check your route configuration: Make sure that the routes are correctly set up in your application. The route for creating should correctly point to the AntdInferencer component. 2. Check your API endpoint: Ensure that the API endpoint you're trying to hit exists and is correctly spelled. As mentioned in the blog post (https://refine.dev/blog/unexpected-token-in-json-at-position-0-error/#hitting-any-api-endpoint-that-does-not-exist), hitting an API endpoint that does not exist can cause issues. 3. Check for errors in the console: There might be errors in your code that are preventing the API call from being made. Check your browser's console for any error messages. 4. Check your authProvider and dataProvider setup: If you're using authentication in your application, make sure that the authProvider is correctly set up. The useIsAuthenticated hook, for example, calls the check method from the authProvider under the hood. If this is not set up correctly, it could prevent API calls from being made. Similarly, ensure that your dataProvider is correctly set up. 5. Check your network tab: The network tab in your browser's developer tools can provide information about outgoing requests. If the API call is not being made, it won't show up here. If none of these suggestions help, please provide more information or context about your issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai9/19/2023
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
Jjolly-crimson9/19/2023
AntdInferencer API not called when goto list @kapa.ai
Kkapa.ai9/19/2023
Let me check the knowledge base for you. One moment! :books: ---------------------- The AntdInferencer component in refine is designed to automatically generate views for your resources. However, it requires the resource, action, and id (if applicable) to be inferred from the current route. If the API is not being called when you navigate to the list, it could be due to a misconfiguration in your routing or resource setup. Based on the code you provided, it seems like you're trying to use AntdInferencer for the list route. However, you didn't specify the resource and action props for the AntdInferencer component. Here's how you can specify these props:
<Route path="/keys" element={<AntdInferencer resource="keys" action="list" />} />
<Route path="/keys" element={<AntdInferencer resource="keys" action="list" />} />
Also, ensure that the resource prop matches the name property of the resource object defined in the Refine component. If you're still facing issues, please provide more information or context about your setup. For more details, you can refer to the Inferencer documentation (https://refine.dev/docs/packages/documentation/inferencer/). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai9/19/2023
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
Jjolly-crimson9/19/2023
<Route path="admin">
<Route path="notifications">
<Route index element={<AntdInferencer />}
</Route>
</Route>
<Route/>
<Route path="admin">
<Route path="notifications">
<Route index element={<AntdInferencer />}
</Route>
</Route>
<Route/>
resource
{
name: "admin/notifications",
list: "/admin/notifications",
create: "/admin/notifications/create",
show: "/admin/notifications/show/:id",
meta: {
label: "Notifications",
canDelete: true,
icon: <KeyOutlined />,
},
},
resource
{
name: "admin/notifications",
list: "/admin/notifications",
create: "/admin/notifications/create",
show: "/admin/notifications/show/:id",
meta: {
label: "Notifications",
canDelete: true,
icon: <KeyOutlined />,
},
},
Not working, infinite request. Here's my code @kapa.ai
Kkapa.ai9/19/2023
Let me check the knowledge base for you. One moment! :books: ---------------------- Based on the provided code, it seems like you're trying to use the AntdInferencer component for the list route. However, the AntdInferencer component requires the resource and action props to be specified. In your case, you should specify the resource prop as "admin/notifications" and the action prop as "list". Here's how you can do it:
<Route path="admin/notifications" element={<AntdInferencer resource="admin/notifications" action="list" />} />
<Route path="admin/notifications" element={<AntdInferencer resource="admin/notifications" action="list" />} />
If you're still facing issues with infinite requests, it could be due to a problem with your API or data provider. Make sure that your API is correctly set up and that your data provider is correctly configured. For more information, you can refer to the Inferencer documentation (https://refine.dev/docs/packages/documentation/inferencer/). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai9/19/2023
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
Ddeep-jade9/19/2023
Hello @tads8799 was the bot's answer helpful?
Jjolly-crimson9/20/2023
@batuhanw no, it's not working
Hharsh-harlequin9/21/2023
If you provide reproducible example, we will happy to debug

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
tutorial is very slow to loadHi, I'm newbie and trying to learn refine.(attracted by the rich features), but the first problem I How to set global error and success notification?I want to set the notification for error and success of API calls globally. Is there a way to implemDebounce on list table CRUD search```tsx const { tableProps, searchFormProps } = useTable<IUser, HttpError, IUserFilterVariables>({ Can I use different menu items for the same resources?resources={[ { name: "post", list: "/post", How to handle with filtersHow to handle the filters in the url http://localhost:5000/class?s=%7B%22%24and%22%3A%5B%5D%7D on a How to handle with array query paramIf filter is a query array param, how can I adjust my request? Using @Query?How to handle filters in NestJS?How to handle filters in NestJS?Not calling list api```tsx { name: "admin/reports", list: "admin/reports", meta: { How to make MUI Autocomplete multipleLike in topic, how to be able to let Autcoomplete using multiple values instead of one?Go back to List after edit or createGo back to List after edit or createToken not visible in header after passingconst check = async () => { try { const { token } = keycloak if (token) { How to tell the front-end how many items the list has?I imagine that in the listing the number of pages is done through a parameter for the number of itemOptimizing for productionHi peepz, I was wondering are there any best practices apart from vite to optimize the bundle for pCannot use import.meta.envError: Property 'env' does not exist on type 'ImportMeta' ```ts export default defineConfig({ plugNot able to translate text while writing testsHi, I am using vitest for writing tests for my refine app. I am not able to translate text using i18Action in Upload Antd Prop do not include Authorization header```tsx <Form {...formProps} layout="vertical" onFinish={async (values) => { connavigate resource with different roles```tsx <Route element={ <Authenticated fallback={<CatchAllNavigadynamically load resource base on rolecustomise show resource , based on cookie stored variableAdd ordinal number columnAdd an extra ordinal number column on LIst pagewhile using POST, PUT, or PATCH if my access token has been expired user will be logged outI have used axios as my HTTP client and using `axios-auth-refresh` for refreshing my access token fr