rival-black
rival-black•17mo ago

Help with "Failed to resolve '@refinedev/inferencer/mantine"?

Hi, I'm trying to adapt Refine into an existing React project (bundled by Parcel). I'm struggling to import the mantine inferencer, as follows:
@parcel/core: Failed to resolve '@refinedev/inferencer/mantine' from './src/Routes.tsx' [...]/frontend/src/Routes.tsx:13:35 12 | import { Refine } from "@refinedev/core"; 13 | import { MantineInferencer } from "@refinedev/inferencer/mantine"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I've manually checked and it seems like everything is installed properly in node_modules - package.json and mantine.js look reasonable in the node_module. My editor also wouldn't auto-import the MantineInferencer, so something's off... I'm not sure how to debug this -- any suggestions?
12 Replies
kapa.ai
kapa.ai•17mo ago
Hey @nilsb7531! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
kapa.ai
kapa.ai•17mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the Refine documentation (https://refine.dev/docs) and Refine blog (https://refine.dev/blog) for more information and examples on using Refine with Mantine. ----------------------
Overview | refine
What is refine?
Blog | refine
A Docusaurus powered blog!
kapa.ai
kapa.ai•17mo ago
<@768857308251815996> kapa.ai is still learning and improving, please let us how it did by reacting below
rival-black
rival-black•17mo ago
Note that I'm able to import Refine from @refinedev/core, but not MantineInferencer from @refinedev/inferencer/mantine
like-gold
like-gold•17mo ago
I reproduced this issue, but I couldn't find solution yet
rival-black
rival-black•17mo ago
did you use parcel to repro? could this be a parcel-specific issue?
like-gold
like-gold•17mo ago
yes i created parcel project and add refine dependencies. I changed some tsconfig, parcel config settings but i couldn't solve the issue. yes it's parcel specific. probably somethings messed up on bundling time. tomorrow I will discuss with the core team Hi @nilsb7531, we discuss with the core team and we found this issue: https://github.com/parcel-bundler/parcel/issues/4155 when you add this to package.json, problem is solved.
"alias": {
"@refinedev/inferencer/mantine": "./node_modules/@refinedev/inferencer/dist/mantine.js"
}
"alias": {
"@refinedev/inferencer/mantine": "./node_modules/@refinedev/inferencer/dist/mantine.js"
}
also we found this package to solve this type of problems but i didn't tested. https://www.npmjs.com/package/@kkirbatski/parcel-resolver-require-resolve
rival-black
rival-black•17mo ago
@alicanerdurmaz thanks so much. this does fix it for me, and TIL about package.json exports. How lame that parcel doesn't support them yet. Also thanks for following up. You guys make a great impression with your project with your communications and helpfulness
like-gold
like-gold•17mo ago
Thank you 🥹 we are glad to hear that
optimistic-gold
optimistic-gold•17mo ago
@alicanerdurmaz - I had a similar issue with the MUI version and decided to manually implement by List. Does this affect all inferencers? Thank you!
like-gold
like-gold•17mo ago
Yes, effects all inferencers when you use parcel. Do you use parcel ?
optimistic-gold
optimistic-gold•17mo ago
I don't use Parcel. We use CRA (with react-app-rewired to help us customize) in a mono-repo setup. But I get the same error. I did confirm in my node modules that the inferencer is correctly installed. I will try the alias as well and see if it works.