useEditableTable error

I'm getting this error on useEditableTable from @refinedev/antd
Error: (0 , _refinedev_antd__WEBPACK_IMPORTED_MODULE_1__.useEditableTable) is not a function
Error: (0 , _refinedev_antd__WEBPACK_IMPORTED_MODULE_1__.useEditableTable) is not a function
How do I solve it? The package version is "@refinedev/antd": "^5.44.0"
3 Replies
kapa.ai
kapa.ai3mo ago
Hi @pedroddomingues. 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 information provided in the knowledge sources, it appears that you may be encountering an issue related to the import or usage of useEditableTable from @refinedev/antd. However, the exact cause is not explicitly mentioned in the given documents. Let me provide some suggestions based on the available information: 1. First, ensure that you are importing useEditableTable correctly from @refinedev/antd. The correct import statement should look like this:
import { useEditableTable } from "@refinedev/antd";
import { useEditableTable } from "@refinedev/antd";
2. If you're using Next.js with Turbo, there might be an issue with the transpilation of the @refinedev/antd package. As suggested in a GitHub issue comment, you could try removing @refinedev/antd from the transpilePackages array in your next.config.mjs file:
// next.config.mjs
// Comment out or remove this line:
// transpilePackages: ['@refinedev/antd'],
// next.config.mjs
// Comment out or remove this line:
// transpilePackages: ['@refinedev/antd'],
GitHub Issue Comment (https://github.com/refinedev/refine/issues/6110#issuecomment-1878056139) 3. Make sure you're using the latest version of @refinedev/antd and that it's compatible with your other dependencies, especially @refinedev/core and antd. 4. If you're using Next.js, ensure that you've set up the Ant Design registry correctly in your application, as mentioned in the migration guide:
import { AntdRegistry } from '@ant-design/nextjs-registry';

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<AntdRegistry>{children}</AntdRegistry>
</body>
</html>
);
}
import { AntdRegistry } from '@ant-design/nextjs-registry';

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<AntdRegistry>{children}</AntdRegistry>
</body>
</html>
);
}
Migration Guide (https://refine.dev/docs/migration-guide/3x-to-4x/#pankodrefine-antd-changes) If these suggestions don't resolve your issue, it might be helpful to create a minimal reproducible example and seek further assistance from the refine community or support channels. The error you're experiencing is not directly addressed in the provided knowledge sources, so a more detailed investigation might be necessary. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@316665199249719296> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
adverse-sapphire
adverse-sapphireOP3mo ago
The issue was solved when I added "use client" at the top of the file.

Did you find this page helpful?