Webpack returning errors from the lib
Hello, I updated refine packages to the latest version, and now is printing errors related to the lib.. Any tips? Weird thing about that is that I have
skipLibCheck: true
in my tsconfig
file, so deps shouldn't be checked by Typescript 🫤20 Replies
like-gold•2y ago
Here is my package.json (nothing fancy)
also, my
tsconfig.json
automatic-azure•2y ago
Hi @kino90, I am happy to see you again 👋
did you try clean install ?
I mean, Installing npm after deleting node_modules and package-lock.json
like-gold•2y ago
hey @alicanerdurmaz 👋 Sadly, yes.. first thing i did was update to the latest packages (as of today.. had this issue since last week), then i removed my whole
node_modules
and package-lock.json
and try installing again.. same errorsautomatic-azure•2y ago
ofc 🙏
import {
RefineProps,
useLogin,
useTranslate,
ILogData,
} from '@pankod/refine-core';
or absolute paths of these fileswhen you import directly like that. without alias, do you have any issues ? i'm still not sure but it's seems not refine problem. I'm able to run a project with that package.json. I believe problem on this config you can try more clear path options like this. I will investigate more. In this time maybe one of our community or core member can find fix 🙏
like-gold•2y ago
I do import them like that, it looks like it's compiling also the deps, which it shouldnt with the
skipLibCheck
option enable.. so weird
errors are triggered from node_modules/@pankod/refine-core/src/...
automatic-azure•2y ago
skipLibCheck
it's just a checking declaration files.
probably we have problem on paths.
typescript path alias setup can be tricky. especially if you are dealing with node_modules.
Can you make some adjustments by looking at the examples here and this note?
https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
when you downgrade, Are the problems resolved?exotic-emerald•2y ago
Hey @kino90, sorry for the issue 🙏 Can you check the version installed before the upgrade (maybe by checking the diff of the package-lock.json). And lets check the changes between the two versions 🤔
Maybe we can try adding
exclude: ["node_modules"]
but it should already be excluded by default of tsc 🤔like-gold•2y ago
Trying installing the old packages
exotic-emerald•2y ago
exotic-emerald•2y ago
Finally been able to reproduce the issue with a faulty import 🤣
In my case, I did import the
LoginPage
component (can be anything) from @pankod/refine-core/src/components/pages/login
which was good for the vscode setup but errored out in compiler
Maybe checking your imports will help? 🤔
Still does not answer it being working on previous versions though 😅like-gold•2y ago
🤔 I'll check my imports then! 🤞 finger crossed!
exotic-emerald•2y ago
Nice! And I'll be trying more ways to reproduce so maybe we can find the real issue here
like-gold•2y ago
It worked! 😍
like-gold•2y ago
I'll list my wrong imports here after the meeting 😉
exotic-emerald•2y ago
Great! 🚀 🚀 I'm really wondering which lines were the problem 😅