question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help(Material Date picker): Issue when adding Datepicker to a remote component in module federation

See original GitHub issue

What 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. image

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:

  1. Clone the repo with the sample app containing the error(click this link)
  2. run npm install
  3. 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:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
alexanderwiebecommented, Feb 14, 2022

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

0reactions
angular-automatic-lock-bot[bot]commented, Apr 16, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >
MindSphere Web Components - Date Time Range Picker
MindSphere Developer Documentation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found