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
exotic-emeraldOP•3y ago
Here is my package.json (nothing fancy)
also, my
tsconfig.json
graceful-blue•3y 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
exotic-emeraldOP•3y 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 errorsgraceful-blue•3y 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 🙏
exotic-emeraldOP•3y 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/...
graceful-blue•3y 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?tame-yellow•3y 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 🤔exotic-emeraldOP•3y ago
Trying installing the old packages
tame-yellow•3y ago
tame-yellow•3y 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 😅exotic-emeraldOP•3y ago
🤔 I'll check my imports then! 🤞 finger crossed!
tame-yellow•3y ago
Nice! And I'll be trying more ways to reproduce so maybe we can find the real issue here
exotic-emeraldOP•3y ago
It worked! 😍
exotic-emeraldOP•3y ago
I'll list my wrong imports here after the meeting 😉
tame-yellow•3y ago
Great! 🚀 🚀 I'm really wondering which lines were the problem 😅
exotic-emeraldOP•3y ago
this are the "strange" imports that caused the issues
tame-yellow•3y ago
Cool!
TitleProps
and LogicalFilter
is already exported from refine-core
so replacing them was not a big deal i guess. But ActionButtonRenderer
is not exported, I'll try to release a quick fix for it, until then maybe something like this might work for you 🤔 (If you are not already resolved this issue 🤣 )
Oh, i guess it's not needed if you already have @pankod/refine-ui-types
installed 😅exotic-emeraldOP•3y ago
TitleProps and LogicalFilter is already exported from refine-core so replacing them was not a big deal i guessI wonder why did WebStorm import them from that weird folder, then 😂 Thanks a lot btw @aliemirs 🙏
tame-yellow•3y ago
Yeah, weird 😅 Let me check if we can do anything to avoid this, declaration maps might be causing this 🤔
Happy to help anytime 🙏
sbagliando si impara, am i right? 🤣 (literally the only proverb i know in italian)
exotic-emeraldOP•3y ago
hahaha indeed, you are right! 😂
Didn't know you could do this with Typescript 🔥 Nice!