Missing dependency "Moment" on new and upgraded projects, while using OwlNativeDateTimeModule
See original GitHub issueEven whilst not using Moment.js, there still appears to be a dependency for this date-time-picker. When you try to npm start a new or upgraded project, you will be hit with:
Error: The target entry-point "@danielmoncada/angular-datetime-picker" has missing dependencies:
- moment
I was able to reproduce the error by creating a new angular app (with Angular Material) and setting up the imports:
@NgModule({
imports: [
OwlDateTimeModule,
OwlNativeDateTimeModule,
],
In projects where we used this date-time-picker, we have always used OwlNativeDateTimeModule and never the OwlMomentDateTimeModule, as stated in the documentation. I got the error after upgrading to Cypress 7, so it appears Cypress 6 was our last package that installed moment as a dependency.
As you might know already know, Moment.js is a legacy project. Reason enough to move away from it in new and upgraded projects, as apparently more projects are doing.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Extend peer dependencies to Angular 8 · Issue #594 - GitHub
You must install peer dependencies yourself. Steps to reproduce and a minimal demo of the problem. npm install with Angular 8.
Read more >Angular 9 - The target entry-point has missing dependencies
I had The target entry-point has missing dependencies error when starting my Angular project with npm run start .
Read more >@danielmoncada/angular-datetime-picker - npm package | Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >Resolving missing dependencies - Zendesk help
This means that when you're in the sandbox, you can see and use them in existing and new triggers. However, if the trigger...
Read more >There has been a missing dependency failure, check the job ...
Since I upgraded our hosted Gitlab EE and Gitlab-runner to 10.8,I get job failures with the message There has been a missing dependency...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, installing Moment.js is a valid workaround for the immediate short term.
However, in doing so I will add a package to my application that’s not in active development anymore, while I purposely configured the date-time-picker to use the
OwlNativeDateTimeModuleinstead of Moment. This is a bad practice.IMHO: The aim should always be to install the least amount of dependencies on a new project and avoid leaving any unwanted, unused or deprecated packages in a project during an upgrade.
Moment.js hadn’t been deprecated yet when the date-time-picker was made. But still the documentation wrongly states:
Source: https://danielykpan.github.io/date-time-picker/#locale-formats
TLDR; I shouldn’t have to install a package I’m not using.
Okay… finally had time to remove the MomentAdapter, and extract it out into a separate project.
This is in the latest version (https://github.com/danielmoncada/date-time-picker/pull/143) v13.1.0.
If anyone does need a MomentJs adapter, you can find it here npm or GitHub.