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

docs-bug(datepicker): some examples are missing 'moment' in dependencies #25136

Closed
fvsch opened this issue Jun 22, 2022 · 1 comment · Fixed by angular/material.angular.io#1156
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team

Comments

@fvsch
Copy link

fvsch commented Jun 22, 2022

Documentation Feedback

When trying to run some of the examples from https://material.angular.io/components/datepicker/overview in StackBlitz using the "Edit … in StackBlitz" buttons at the top right, I’m getting build-time errors like:

Error: src/app/datepicker-moment-example.ts:10:26 - error TS2307: Cannot find module 'moment' or its corresponding type declarations.

10 import * as _moment from 'moment';
                            ~~~~~~~~

The package.json file for those examples do not seem to specify "moment" as a dependency.

Example project created using the Edit in StackBlitz button:
https://stackblitz.com/edit/angular-material-datepicker-missing-dep

If I download the project files locally and try to run it with npm install && npm start, I’m getting the same error. So it looks like a problem with the project files, especially its package.json, rather than a problem with StackBlitz's package manager.

I haven't checked every single example, but found one myself and there's a report about a second one in stackblitz/webcontainer-core#728, so it might be good to check the dependencies for all the datepicker examples that use moment.

Affected documentation page

https://material.angular.io/components/datepicker/overview

@fvsch fvsch added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Jun 22, 2022
zarend added a commit to zarend/material.angular.io that referenced this issue Jun 23, 2022
Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular/components#25136
zarend added a commit to zarend/material.angular.io that referenced this issue Jun 23, 2022
Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular/components#25136
zarend added a commit to angular/material.angular.io that referenced this issue Jun 23, 2022
Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular/components#25136
devversion pushed a commit to angular/material.angular.io that referenced this issue Jun 24, 2022
Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular/components#25136
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 24, 2022
DigitalMaestro89 added a commit to DigitalMaestro89/material.angular.io that referenced this issue Apr 23, 2024
Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular/components#25136
alexeagle pushed a commit to alexeagle/material2 that referenced this issue Nov 6, 2024
…1156)

Adds `@angular/material-moment-adapter` and `moment` to the package.json
on stackblitz examples. This fixes the "Cannot find module 'moment' or
its corresponding type declarations." in some examples.

Fixes angular#25136
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant