exotic-emerald
exotic-emerald4mo ago

Refine dist folder removed @refinedev/core/dist/interfaces

I cannot upgrade because there are tons of missing dependencies now. None of these imports work anymore:
import { AuthBindings } from "@refinedev/core/dist/interfaces";
import { IDataContextProvider } from "@refinedev/core/dist/interfaces";
import { INotificationContext } from "@refinedev/core/dist/interfaces";
import { Fields } from "@refinedev/core/dist/interfaces/metaData/fields";
import { useQuery } from "@refinedev/core/node_modules/@tanstack/react-query";
import { QueryObserverResult } from "@refinedev/core/node_modules/@tanstack/query-core";
import { QueryBuilderOptions } from "@refinedev/core/dist/interfaces/metaData/queryBuilderOptions";
import { AuthBindings } from "@refinedev/core/dist/interfaces";
import { IDataContextProvider } from "@refinedev/core/dist/interfaces";
import { INotificationContext } from "@refinedev/core/dist/interfaces";
import { Fields } from "@refinedev/core/dist/interfaces/metaData/fields";
import { useQuery } from "@refinedev/core/node_modules/@tanstack/react-query";
import { QueryObserverResult } from "@refinedev/core/node_modules/@tanstack/query-core";
import { QueryBuilderOptions } from "@refinedev/core/dist/interfaces/metaData/queryBuilderOptions";
6 Replies
kapa.ai
kapa.ai4mo ago
Hi @geoffatsource. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The issue you're experiencing is due to changes in the way @refinedev/core handles imports. As per the migration guide (https://refine.dev/docs/migration-guide/3x-to-4x#import-changes), all @tanstack/react-query imports that were previously re-exported from @refinedev/core have been removed. You now need to import them directly from the @tanstack/react-query package. For example, instead of:
import { QueryClient } from "@refinedev/core";
import { QueryClient } from "@refinedev/core";
You should now use:
import { QueryClient } from "@tanstack/react-query";
import { QueryClient } from "@tanstack/react-query";
If the @tanstack/react-query package is not installed, you can install it with your package manager:
npm install @tanstack/react-query
npm install @tanstack/react-query
or
pnpm add @tanstack/react-query
pnpm add @tanstack/react-query
or
yarn add @tanstack/react-query
yarn add @tanstack/react-query
As for the other imports from @refinedev/core/dist/interfaces, it seems like they might have been moved or renamed in the new version. You might need to check the updated documentation or source code to find their new locations or names. If you're still having trouble, consider reaching out to the Refine community or maintainers for more specific guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@1014305963219615754> kapa.ai is still learning and improving, please let us know how it did by reacting below
exotic-emerald
exotic-emerald4mo ago
GitHub
refactor(core): update type definitions (#5755) · refinedev/refine@...
* refactor(core): access control * refactor(core): audit log * refactor(core): auth * refactor(core): data * fix(core): missing exports, test types * refactor(core): i18n * refact...
exotic-emerald
exotic-emerald4mo ago
I think a migration guide or migrate tool would help us here
metropolitan-bronze
metropolitan-bronze4mo ago
Hey @geoffatsource, in @refinedev/core imports other than the root wasn't meant to resolve in the first place. Those should never be imported like this. Just checked your list of imports, they can be replaced by imports from root or can be extracted through utilities like: QueryObserverResult can be extracted from data hooks like ReturnType<typeof useList> QueryBuilderOptions and Fields can be extracted from MetaQuery type. AuthBindings and INotificationContext is already exported and IDataContextProvider can be replaced with DataProvider or DataBindings or DataProviders types I'll be happy to help if you have any missing types not exported from root and cant be obtained from other types
exotic-emerald
exotic-emerald3mo ago
Thank you!