Unable to resolve X from “navigation/MainNavigator.jsx”

I’ve recently started having an issue with my app not being able to build it’s JavaScript bundle due to not being able to find a file.


Failed building bundle

As you can see by these screenshots, the file is in the correct place and my IDE is even recognising that the file exists.


Path to the file

IDE navigation screenshot:

folder structure

I have checked to make sure I have no conflicting package versions and I can’t find any, I have also ran expo start -c to reset my cache. Finally, I have also delete node_modules and re-installed packages, so far none of these are working!

Does anyone know what might cause this?


For anyone who may run into this issue, in my case it was caused by me declaring the same screen twice in my navigation controller, check that you haven’t made any mistakes in your stack navigators (if you are using react-native) as for some reason a mistake in your stack navigator causes this ‘unable to resolve’ error.