Errors after switching to @react-native-vector-icons/material-design-icons
Current behaviour
After switching from "react-native-vector-icons" to "@react-native-vector-icons/material-design-icons" and updating react-native-paper to v5.14.1, I get the following errors when starting the Android App:
I followed the steps for migrating to @react-native-vector icons v12.
Expected behaviour
The App should run.
How to reproduce?
Preview
What have you tried so far?
With react-native-paper 5.13.5 and react-native-vector-icons using MaterialCommunityIcons everything worked fine.
Your Environment
| software | version |
|---|---|
| ios | - |
| android | 14 |
| react-native | 0.77.2 |
| react-native-paper | 5.14.1 |
| node | 22.14.0 |
| npm | 10.9.2 |
| expo sdk | - |
@atheck could you please attach the repro?
Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.
I have a similar problem in a react-native-web + RNP project. The latest RNP version throws this runtime error: "Failed to resolve import "@react-native-vector-icons/material-design-icons" from "node_modules/.vite/deps/react-native-paper.js?v=0e6453b5". Does the file exist?" I downgraded back to RNP 5.13.1 and everything works fine.
Hey @alariej, please try to reproduce on the simple setup and attach the repo.
I'm encountering the same issue in react-native-paper version 5.6.0. Is there any known workaround or recommended fix for this?
I created a new react-native app using react-native 0.77.2, react-native-paper 5.14.3 and @react-native-vector-icons/material-design-icons 12.0.0. It is working.
I'll try to find the problem in my other app and leave a comment here how I solved it.
I have been working on a project with nativewind. Upgrading from 5.13.1 to 5.14.3 caused this error to popup
For me, it was due to the nativewind plugin which was causing this error. Removing it fixed it but I am not pretty sure how to solve it with nativewind in place.
Downgrading it to 5.13.1 puts everything back to normal
Just throwing this comment out here if it is of any help to anyone who is able to solve it. Maybe it is due the metro or babel config files!
Thanks
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.
I still have this issue and will try to figure out why when I have some time.
The same thing happened to me
I downgraded to version 5.13.1 and it works.
I solved it by removing the inlineRequires property in the metro config:
From:
const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
To:
const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
},
}),
},
};
downgrading works!
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.