R
Refine

ask-any-question

Failed npm run build with lots of errors:

Aabsent-sapphire2/18/2024
Failed npm run build with lots of errors:
Kkapa.ai2/18/2024
Hi @lukevo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but I can't provide a solution without more specific details about the errors you're encountering. The errors could be due to a variety of reasons such as missing dependencies, incorrect configuration, or incompatible versions of packages. Please make sure you've installed all necessary packages and that your configuration files are set up correctly. If you're still having trouble, you might find it helpful to check the official Refine documentation (https://refine.dev/docs) or the Refine GitHub issues page (https://github.com/refinedev/refine/issues) for similar problems and their solutions. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai2/18/2024
<@582491401715974144> kapa.ai is still learning and improving, please let us know how it did by reacting below
Aabsent-sapphire2/18/2024
I have attached the file @kapa.ai
Kkapa.ai2/18/2024
Let me check the knowledge base for you. One moment! :books: ---------------------- I'm sorry, but as an AI, I'm unable to access or view attached files. However, I can help you troubleshoot based on the error messages or issues you describe. Please provide more details about the errors you're encountering during the build process. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai2/18/2024
<@582491401715974144> kapa.ai is still learning and improving, please let us know how it did by reacting below
Aabsent-sapphire2/18/2024
These are some of the errors: import { useResource } from "@hooks/resource"; ~~~ node_modules/@refinedev/core/src/hooks/invalidate/index.tsx:9:34 - error TS2307: Cannot find module '@definitions' or its corresponding type declarations. 9 import { pickDataProvider } from "@definitions"; ~~ node_modules/@refinedev/core/src/hooks/invalidate/index.tsx:11:25 - error TS2307: Cannot find module '@hooks/useKeys' or its corresponding type declarations. 11 import { useKeys } from "@hooks/useKeys"; ~~~~ node_modules/@refinedev/core/src/hooks/legacy-router/useRouterContext.ts:2:48 - error TS2307: Cannot find module '@contexts/legacy-router' or its corresponding type declarations. 2 import { RouterContext, defaultProvider } from "@contexts/legacy-router"; ~~~~~ node_modules/@refinedev/core/src/hooks/live/useLiveMode/index.ts:3:31 - error TS2307: Cannot find module '@contexts/refine' or its corresponding type declarations. 3 import { RefineContext } from "@contexts/refine"; ~~~~ node_modules/@refinedev/core/src/hooks/live/usePublish/index.ts:3:29 - error TS2307: Cannot find module '@contexts/live' or its corresponding type declarations. 3 import { LiveContext } from "@contexts/live"; ~~~~ @kapa.ai
Kkapa.ai2/18/2024
Let me check the knowledge base for you. One moment! :books: ---------------------- The errors you're encountering seem to be related to missing modules or incorrect import paths in your project. Here are a few steps you can take to troubleshoot: 1. Check your import paths: Make sure that the paths you're using to import modules are correct. For example, the error Cannot find module '@hooks/useKeys' suggests that the module useKeys cannot be found at the specified path. Make sure that the file exists and the path is correct. 2. Install missing dependencies: If certain modules are missing from your node_modules directory, you might need to install them. You can do this by running npm install in your project directory. 3. Check your TypeScript configuration: If you're using TypeScript, make sure your tsconfig.json file is correctly set up. You might need to adjust your compilerOptions to correctly resolve modules. If you're still encountering issues, you might find it helpful to check the official Refine documentation (https://refine.dev/docs) or the Refine GitHub issues page (https://github.com/refinedev/refine/issues) for similar problems and their solutions. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai2/18/2024
<@582491401715974144> kapa.ai is still learning and improving, please let us know how it did by reacting below
Aabsent-sapphire2/18/2024
This is my tsconfig @kapa.ai { "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "ESNext", "moduleResolution": "Node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./src", "paths": { "@/": ["./"] } }, "include": ["src", "vite.config.ts"], "references": [{ "path": "./tsconfig.node.json" }] }
Kkapa.ai2/18/2024
Let me check the knowledge base for you. One moment! :books: ---------------------- Your tsconfig.json file seems to be correctly set up for a typical TypeScript project. However, the errors you're encountering suggest that the paths for certain modules can't be resolved. One potential issue could be with the paths option in your tsconfig.json file. You've set "@/*": ["./*"] which means that TypeScript will look for modules starting with @/ in the same directory as the tsconfig.json file. If your modules are located elsewhere, you'll need to adjust this path. For example, if your modules are located in a src directory, you might need to change your paths option to:
"paths": {
"@/*": ["./src/*"]
}
"paths": {
"@/*": ["./src/*"]
}
This tells TypeScript to look for @/ imports in the src directory. Also, ensure that the baseUrl is correctly set. The baseUrl is a directory that TypeScript uses to resolve non-relative module names. In your case, it's set to ./src, which means TypeScript will use the src directory as a starting point for module resolution. If you're still encountering issues, you might find it helpful to check the official Refine documentation (https://refine.dev/docs) or the Refine GitHub issues page (https://github.com/refinedev/refine/issues) for similar problems and their solutions. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai2/18/2024
<@582491401715974144> kapa.ai is still learning and improving, please let us know how it did by reacting below
Sstormy-gold2/18/2024
@lukevo This looks like an issue with your imports, can you check if all your imports from refine packages are appropriate and doesnt import things from /dist/… etc. ?
Aabsent-sapphire2/18/2024
@aliemir confirmed, no idea what's going on
No description
Aabsent-sapphire2/18/2024
Everything related to @hooks
Aabsent-sapphire2/18/2024
Found it @refinedev/core/config.json: { "include": ["src", "types"], "extends": "../../tsconfig.build.json", "compilerOptions": { "rootDir": "./src", "baseUrl": ".", "importHelpers": false, "paths": { "@components/": ["src/components/"], "@components": ["src/components"], "@containers/": ["src/containers/"], "@containers": ["src/containers"], "@pages/": ["src/pages/"], "@pages": ["src/pages"], "@contexts/": ["src/contexts/"], "@contexts": ["src/contexts"], "@dataProviders/": ["src/dataProviders/"], "@dataProviders": ["src/dataProviders"], "@hooks/": ["src/hooks/"], "@hooks": ["src/hooks"], "@test/": ["test/"], "@test": ["test"], "@definitions/": ["src/definitions/"], "@definitions": ["src/definitions"] }, "typeRoots": ["./types", "../../node_modules/@types"] } } Cannot read file 'd:/dental-crm-beta/node_modules/tsconfig.build.json'.ts JSON schema for the TypeScript compiler's configuration file This is problematic: "extends": "../../tsconfig.build.json",
Sstormy-gold2/18/2024
Thanks for confirming, can you also check if there are any imports like @refinedev/core/src…? Leaning on to this because i dont think there are any reasons for the tsconfig file in a node modules to be included in the run like this 🤔 can you also share info about your setup and project, preferrably an output of refine whoami through @refinedev/cli 🙏 Lets find whats causing the tsconfig to be included in the bundle and solve it 🚀 Do you have a custom exclude field in your tsconfig.json? If so, does it include node_modules in it?
Aabsent-sapphire2/18/2024
my tsconfig: { "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "ESNext", "moduleResolution": "Node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./src", "paths": { "@/": ["./"] } }, "include": ["src", "vite.config.ts"], "references": [{ "path": "./tsconfig.node.json" }], "exclude": ["node_modules"] } I have solved this by instead of running npm run build, I just do npm run refine build I actually do "@refinedev/core/src" import this
Aabsent-sapphire2/18/2024
To achieve custom menu order and hierachy nested

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
OpenAPI Codegen with Refine (REST API Provider)Hey, I have a solid REST API which has an OpenAPI specification. I was wondering if that could be uI18n locale change doesn't change column headerNameOn selecting different locale via I18n provider, everything translates instantly except column all oSupabase authentication with refinenativeHi, I am trying to build a mobile application with react native using the community package https://Hiding a button in the List (MUI)What is the cleanest way to hide (not disable) create button on <List> if user is not authorized? I error when i use refine with nextjs #nextjs #clihello ,when i generate a new refine project using nextjs i got an error at the build and run …nextjswith useDataGrid how to omit query argshow to not add ?& to /resource?& when using useDataGridfilterhow to filter data without using a table.Pagination with @refinedev/graphql providerHi Everyone. I am building some CRUD pages in our product and found Refine to be a great fit for ouhow to add a custom button in the Show header buttons along with the refresh buttonI have a show view with its buttons for delete, go back and refresh. I want to add a new one to openClear cachehow to clear cache ?useStepsFormHi, how can I use useStepsForm, with custom input fields without register, if some of the data I neeAccess control for create Button doesnot work<CreateButton accessControl={{ enabled: false }} type="primary" ghost icon={<PlusOutlined />}> how to translate the sider// Package Imports import React from 'react'; import { ThemedSiderV2, type RefineThemedLayoutV2Sautocomplete hookI am using mui and i want to send a request and get a new value when i change the value of auto comphow to re-style savebuttonprops?how to re-style savebuttonprops?Resource list response in JSEND FormatI have backend which do not return list as json array in the http response. The server send it in JCreating a project with example pages doesn't workHello, I have tried to create a project using pnpm. I selected REST API, and installed packages withCheck gets called after redirectTo /loginWhen I call my logout function and redirect user to /login, check() from authProvider gets called evExpose local IPHow to expose IPHow can I pass the changed values in child props to the parent state?children props ``` export const EditFirstEventProps = ({ items, id }: IEditFirstEventProps) => {