Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve 'moment' in 'node_modules/react-datetime/dist' #873

Open
diennn-gg opened this issue Sep 20, 2024 · 2 comments

Comments

@diennn-gg
Copy link

I'm encountering the following error while using react-datetime:
Module not found: Error: Can't resolve 'moment' in 'node_modules/react-datetime/dist'
However, I don't want to install moment in my project. Is there a way to use react-datetime without needing moment as a dependency?

Could you provide guidance on how to resolve this issue or suggest alternatives to avoid installing moment?

Thanks in advance!

@noxxxxxxxx
Copy link

@diennn-gg try rc-calendar-picker, use dayjs as dependency, same api with this repo

https://github.com/noxxxxxxxx/react-calendar

@iharzh
Copy link

iharzh commented Jan 20, 2025

@diennn-gg You see the error since the package requires moment as a peer dependency, which you don't want to install. I guess you can make a fork and replace moment with dayjs or any other library of your choice. However, some additional effort might be required to support timezones etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants