Module not found: Can't resolve
xxleyi opened this issue · 4 comments
Module not found: Can't resolve 'click-to-react-component'
I am trying this awesome tool, but can not use it as a package. For now, I put src files in my components folder.
If I try import from package directly, I will meet resolve error like above.
Don't know why, seems others do not have this problem.
My webpack is webpack@4.46.0
What's your webpack config? Does it resolve .mjs
files?
You can fork the repo and put it in https://github.com/ericclemmons/click-to-component/tree/main/apps as a PR & I'll help troubleshoot it.
What's your webpack config? Does it resolve
.mjs
files?You can fork the repo and put it in https://github.com/ericclemmons/click-to-component/tree/main/apps as a PR & I'll help troubleshoot it.
The compile and build tool I am using is provided by my company, and is under maintained. New version can compile click-to-react-component. I will update this compile tool in some day.
Got it! I'll go ahead & close this then – to support webpack
(which powered Next.js & CRA), we'd at least need a reproducible sample under /apps
to work off of.
Hi ! Same issue for me, I managed to make the lib works by adding "main": "./src/index.js"
in package.json.
Looks like the "exports" alternative is not working for me for some reasons.
The error came from my Eslint.
CRA 5.0.1
Eslint 8.13.0
Node 16.14.2
Webpack 5.72.0
Edit : Found out that the problem is coming from my Eslint plugin : import-js/eslint-plugin-import#1810