help(Material Date picker): Issue when adding Datepicker to a remote component in module federation
See original GitHub issueWhat are you trying to do?
I am trying to use datepicker within an remote component using module federation and am getting the attached error message.
What troubleshooting steps have you tried?
- Added
@angular/material
as shared library to webpack config of all projects - Tried adding
@angular/material/core
as shared library to webpack config of all projects - Added MatDatepickerModule and MatNativeDateModule to import of App Modules of both base and remote projects
- Tried Adding MatDatepickerModule and MatNativeDateModule as providers too.
- Tried installing
@angular/material-moment-adapter
and using it instead of MatNativeDateModule.
Reproduction
Steps to reproduce:
- Clone the repo with the sample app containing the error(click this link)
- run npm install
- run following commands in separate terminals
- npx ng s
- npx nx build remote -c=development --watch
- npx http-server dist/apps
Environment
- Angular: 12.3.3
- CDK/Material: 12.2.13
- Browser(s): Microsoft Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Error when adding Datepicker to a remote component in ...
Solution was to add '@angular/material/datepicker' as a shared package in webpack config. The second ...
Read more >Revolutionizing Micro Frontends with Webpack 5, Module ...
It's time to test Module Federation by exposing Header component. You need to import the ModuleFederationPlugin and add it into your webpack ...
Read more >Using Angular Material DatePicker Component in ... - YouTube
Angular Tutorial:#angular #frontend #nitishkaushikGitHub Repo: ...
Read more >uncaught typeerror: cannot read properties of undefined ...
The error happens when I import my LabelModule into the FormFieldModule. Then I use the Label Component in the FormField Component.
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 FreeTop 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
Top GitHub Comments
MatInputModule module needs to be imported by both remote and container.
That is a separate issue though, you can validate the date picker works by commenting out the mat-form-field in remote-animate-component.html
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.