I was working in my project with no problem, the last thing I had installed was the react-native-video-player and all was working well. I ran into a normal error, I think it was a typo I had just added, something simple, and it shut down the app, as expected. I fixed the error and tried to start the project again, to be greeted with the following error, seen in the title...
TypeError: undefined is not an object (evaluating '_MaterialIcons.default.propTypes.style')
I then tried the usual slew of things I try when something in a file that I have no access to is bugging. I deleted node_modules and my package.lock.json and reran npm i. I kept getting the same error, proceeded by a few different ones. After trying numerous solutions, uninstalling different npm packages that I thought would be the culprit, and no success.
The way I got the errors and any errors proceeding the initial one kept changing, but now I've hit a wall. The phone simulator white screens, and I get the following three errors in my Metro Bundle Terminal:
TypeError: undefined is not an object (evaluating '_MaterialIcons.default.propTypes.style')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
I then created a new branch where I deleted node_modules, package.lock.json, yarn.lock, and even my package.json. When I then tried to start the app using npx react-native run-is, I got the expected prompt to install React Native. I did, and it installed. Once it installed, I got the same error! If I run a search for the words involved with the error-- nothing, if I try to search for the page in which the error occurs-- nothing. So this means it HAS to be in the node_modules, as those are the only files where searches don't hit. I truly have no idea how to solve this, as I haven't used material icons anywhere (including my yarn.lock, my package.json, and my package.lock.json)
To summarize the steps I've tried to no avail (in no order, I don't remember anymore)...
- deleted
node_modules,package.lock.jsonandyarn.lockand rannpm iandyarn - deleted
ios/podsandios/buildandios/Podfile.lockand ranpod install - ran
pod update - Some combination of 1, and 2
- run
npm uninstall material-icons - Deleted all node related, and yarn related files and directories and started fresh with a brand new react-native install
- run
yarn cache clean - run killall -9 node
- run
npm audit -fix - Restarted my machine
I should have tried this earlier, but it ended up being something messed up in the
react-native-video-player. They had to have added something to it very recently, as I was successfully using it awhile ago. Gotta love when they up upload deprecated packages