9

I installed https://github.com/isaacplmann/ngx-tour module and integrated as per guidelines but I am getting export materialmodule was not found in angular/material and other same kind of errors on npm start or build. what could be the issue here and how can it be resolved. I already have checked the packages and they all are installed.

Thanks

FAISAL
  • 33,618
  • 10
  • 97
  • 105
Vikram
  • 3,171
  • 7
  • 37
  • 67

3 Answers3

11

MaterialModule depreciated in version 2.0.0-beta.3 and it was removed completely in version 2.0.0-beta.11. See this CHANGELOG for more details. Please go through the breaking changes.

MaterialModule has been removed and is no longer available. As noted in the changelog for beta.3, an aggregate module like MaterialModule prevents tools from being able to treeshake unused components and modules.

Also, with 2.0.0-beta.11 and greater, update your angular version to 4.4.3 or greater. Material 2.0.0-beta.11 depends on 4.4.3 or greater. Feom the CHANGELOG:

Breaking changes Angular Material now requires Angular 4.4.3 or greater

Now you have two options:

  1. Dowgrade to 2.0.0-beta.10
  2. Include individual material component modules in order to use them in your app.

In second case,

import { MatSelectModule, MatButtonModule } from '@angular/material';

...
imports: [ 
    ....
    MatSelectModule,
    ‎MatButtonModule
]

Lastly, remeber that since 2.0.0-beta.12 the Md prefix has been removed and you should use Mat prefix everywhere. From the CHANGELOG of 2.0.0-beta.11:

For beta.11, we've made the decision to deprecate the "md" prefix completely and use "mat" moving forward. This affects all class names, properties, inputs, outputs, and selectors (CSS classes were changed back in February). The "md" prefixes will be removed in the next beta release.

And from the CHANGELOG of 2.0.0-beta.12:

Breaking Changes All "md" prefixes have been removed.

See this working StackBlitz demo with individual material modules and using Mat prefix.

FAISAL
  • 33,618
  • 10
  • 97
  • 105
5

Well, the module is gone. Either you downgrade to "@angular/material": "2.0.0-beta.10" as @yurzui suggested.

Or -- better -- just don't use it in your AppModule. Just import the specific modules of interest, like MatButtonModule (because even MdButtonModule is deprecated).

Igor Soloydenko
  • 11,067
  • 11
  • 47
  • 90
  • `Or -- better` then he has to change `md` to `mat` prefix everywhere in that ngx-tour package https://github.com/isaacplmann/ngx-tour/blob/master/ngx-tour-md-menu/src/tour-step-template.component.ts#L11 – yurzui Oct 08 '17 at 06:51
  • @yurzui I am not a contributor of that package. Feel free to post a pull request if you will. – Igor Soloydenko Oct 08 '17 at 06:52
0

Replace in imports MdCardModule, MdMenuModule, MdToolbarModule, MdIconModule etc if not all but most of them are changed and keyword Md is replaced Mat keywork i.e MatSelectModule, MatCardModule, MatMenuModule etc. Thanks for the above answers. They had reasons, while I have a short answer.. Cheers.

Jared Forth
  • 1,577
  • 6
  • 17
  • 32
Farid Abbas
  • 294
  • 4
  • 5