Environment :
macOS Sierra v10.12.6
Processor 2,3 GHz Intel Core i5
expo: 36.0.0
react: 16.9.0 (React Native 0.60 and 0.61)
Platforms : iOS & Android
Versions: react-native-modal-datetime-picker: 8.1.0
Description : When I migrate to v8.1.0 of the react-native-modal-datetime-picker, the terminal throws this error at me : Unable to resolve "./CustomDatePickerAndroid" from "node_modules/react-native-modal-datetime-picker/src/index.js"
Failed building JavaScript bundle.
What have I tried ?
Can anyone please advice on how to rectify this problem ? Any help will be appreciated.
@fromsujay could you check what the content of node_modules/react-native-modal-datetime-picker/src/index.js is?
I would expect it to be the same as this file.
If it's not, I would suggest you to reset the metro bundler/server, uninstall and reinstall your app and try again.
Thanks for your response @mmazzarolo. I have checked the contents of the file. They are exactly the same.
After more than 2 hours of trial and error, I uninstalled both react-native-modal-datetime-picker and @react-native-community/datetimepicker. Then I reinstalled both by chaining them this way :
npm i react-native-modal-datetime-picker @react-native-community/datetimepicker
This seems to have done the trick.
Thanks for your help anyways @mmazzarolo and great work on developing this useful module 馃憤
Hi
Good afternoon
I just made the update from version 7.6 to 8.1 and I am having this error in iOS, I already uninstall of the 2 libraries, I did clean of the build in Xcode, uninstall the app and the error continues, any other suggestions? @mmazzarolo
Thanks
Reset the metro bundler npm run start -- --reset-cache
It worked, thank you very much
I had the same error about
Unable to resolve "./CustomDatePickerAndroid" from "node_modules/react-native-modal-datetime-picker/src/index.js"
Failed building JavaScript bundle.
Environment:
Platforms :
iOS & Android
Versions:
react-native-modal-datetime-picker: 8.5.4
@react-native-community/datetimepicker: 2.2.2
It did not work. Please help me @mmazzarolo
I tried re-install and ran expo start -c a lot of time. I also checked the contents of the file you sent above they are the same.

@lisa-nguyen-goldenowl
Estoy trabajando con expo sdk 37.0.0 y me apareci贸 el mismo error. La soluci贸n la encontr茅 en la pagina de npm [https://www.npmjs.com/package/react-native-modal-datetime-picker]. Ah铆 aparecia la opcion de instalar con expo, mientras que lo estaba haciendo con npm. Los pasos que segui fueron:
1 npm uninstall @react-native-community/datetimepicker
2 npm uninstall react-native-modal-datetime-picker
3 rm -rf node_modules
4 npm i
5 expo install react-native-modal-datetime-picker @react-native-community/datetimepicker
Espero les sirva. Saludos.
Thanks @sistemasjhdez.
i don't know why but i copy file node_modules/react-native-modal-datetime-picker/src/index.js and paste in my node_modules. Restart and then it works.
Reset the metro bundler
npm run start -- --reset-cache
Thank you. This worked for me!
Most helpful comment
Reset the metro bundler
npm run start -- --reset-cache