commenthol / date-holidays

worldwide holidays
https://commenthol.github.io/date-holidays/
Other
923 stars 239 forks source link

How can I use this package in react native applications? (However, this package itself specifies a main module field that could not be resolved ) #292

Closed rubanraj54 closed 2 years ago

rubanraj54 commented 2 years ago

Hi,

Thanks for the great package.

I would like to use this package in react native applications, but I am getting the following error.

Screenshot 2021-11-22 at 17 15 04

I tried this solution(https://stackoverflow.com/a/60126739/2708249) but didn't work.

Could you/anyone please let me know how can I use this package in react-native applications?

Thanks.

RosCoder commented 2 years ago

@rubanraj54 Hey! Metro does not support packages with .cjs sources. This solution works for me: https://github.com/facebook/metro/issues/535#issuecomment-970443661

rubanraj54 commented 2 years ago

@RosCoder Thanks for the hint, let me try your solution.

rubanraj54 commented 2 years ago

@RosCoder Thanks, your solution fixed the issue.

sid028 commented 1 year ago

Getting same issue : https://stackoverflow.com/questions/74318272/date-holidays-invariant-violation-module-appregistry-is-not-a-registered-calla