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.

Some Material Modules not working after v9 update

See original GitHub issue

Regression

I updated my project to version 9 of angular and I updated Angular material as well. Before the update everything was working fine, but after the update, the following Angular Material Modules are not working. MatBottomSheetModule MatSnackBarModule

The following are working but tslint shows the modules do not have exported members. MatChipsModule MatAutocompleteModule

Here is my customized material module

import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatChipsModule } from '@angular/material/chips'; import { MatIconModule } from '@angular/material/icon'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatBottomSheetModule } from '@angular/material/bottom-sheet';

Expected Behavior

All modules should have exported members

Actual Behavior

Module 'node_modules/@angular/material/snack-bar' has no exported member 'MatSnackBarModule'.

Module 'node_modules/@angular/material/chips' has no exported member 'MatChipsModule'.

Module 'node_modules/@angular/material/bottom-sheet"' has no exported member 'MatBottomSheetModule'.

Module 'node_modules/@angular/material/autocomplete' has no exported member 'MatAutocompleteModule'.

Environment

  • Angular: 9.0.1
  • Node Version: 12.13.1
  • CDK/Material: 9.0.0
  • Browser: Chrome, Opera, Mozilla
  • Operating System: Windows 10, x64

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
SteeveGLcommented, Feb 9, 2020

I got the same issue and fixed it.

In my Visual Studio Code, some modules was not found even they was in my node_modules.

What I did to fix:

  1. Deleted my node_modules directory.
  2. Installed NPM package: npm install
  3. Restarted Visual Studio Code.
  4. Issue gone!
1reaction
jelbourncommented, Feb 10, 2020

Going to close this then, since it seems like it was an environment / node_modules issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular material not working in angular version 9
1. 1. · yes, I update angular-material 9.0.0. . and I import mat button module but it showing simple button · 1. Show...
Read more >
Angular Material modules not recognized after building the ...
Tried to add HTML tags for Material components - no results; Updates imports in the Module; ngcc compiled imported module; 5-10 mins later...
Read more >
Update Angular to v15
This topic provides information about updating your Angular applications to Angular version 15. For a summary of this information and the step-by-step ...
Read more >
@angular/material - npm
The sources for this package are in the main Angular Material repo. Please file issues and pull requests against that repo. License: MIT ......
Read more >
angular material on v15 upgrade is a complete mess - Reddit
Not sure how you did the update, but, when running ng update @angular/material, the schematic replaces all your material import with « Mat…...
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