Ignite Issues with Babel-Module-Resolver #1806
Unanswered
OfficialDarkComet
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I know others have had similar issues in the past. Would like to have some help from the community to diagnose this, as I'd like it to work as well! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm still fairly new to React-Native, but I've used babel-module-resolver with other projects without issue (all using Expo). It essentially makes "shortcuts" for module imports that can be used by any file in your project, meaning "../../components/" becomes "@components/".
Unfortunately, I am unable to get it to work with projects created using Ignite. I am using the same config for both babel and typscript as I did for my other projects, but none of the "shortcuts" are working. Instead, (I am using VS Code) I get this error...
In the image above, the first line uses babel-module-resolver and the second line does not, both referring to the same button component, but only the first line is giving the error "Cannot find module '@components/button/button' or its corresponding type declarations".
Here is my babel.config.js
and here is my tsconfig.json
I've tried messing with the webpack.config.js file as that wasn't included in my other projects that had babel-module-resolver working without errors. I've tried excluding the "extensions", "root" and "baseUrl' from the babel and ts config files as well. Like I mentioned before, none of the paths are working and all give the same error. And I also tried re-adding babel-module-resolver using yarn (even though it is already included with Ignite's boilerplate).
Anyone have any suggestions on how I can resolve the issue?
Thank you for your time and I appreciate any help that is provided.
- Logan (aka DarkComet)
Beta Was this translation helpful? Give feedback.
All reactions