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.

Build Error: `@angular/material/material"' has no exported member`

See original GitHub issue

Bug, feature request, or proposal:

Build is crashing

What is the expected behavior?

Webpack is able to correctly import Material2 modules

What is the current behavior?

Webpack is not finding the export definitions

What are the steps to reproduce?

Not sure how to show it, but this occurred after doing a yarn/npm update.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

$ ng version @angular/cli: 1.4.5 node: 7.2.1 os: win32 x64 @angular/animations: 4.4.4 @angular/cdk: 2.0.0-beta.12 @angular/common: 4.4.4 @angular/compiler: 4.4.4 @angular/core: 4.4.4 @angular/flex-layout: 2.0.0-beta.9-c3c7151 @angular/forms: 4.4.4 @angular/http: 4.4.4 @angular/material: 2.0.0-beta.12-7fe1b81 @angular/platform-browser: 4.4.4 @angular/platform-browser-dynamic: 4.4.4 @angular/router: 4.4.4 @angular/cli: 1.4.5 @angular/compiler-cli: 4.4.4 @angular/language-service: 4.4.4 typescript: 2.5.3

Is there anything else we should know?

It’s the same symptoms #4521 shows. However the resolution there seemed to be updating to the latest build, which I’ve done and may have caused this issue to begin with.

Here is the stacktrace output:

Date: 2017-10-10T18:06:23.412Z
Hash: 23a3fb495d1cd162281d
Time: 5726ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 1.06 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 66.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 338 kB [initial] [rendered]

ERROR in <APP_PATH> (13,44): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdNativeDateModule'.
ERROR in <APP_PATH>/src/app/components/<MY_COMPONENT> (8,10): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSliderChange'.
ERROR in <APP_PATH>/src/app/components/<MY_COMPONENT> (8,10): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MD_DIALOG_DATA'.
ERROR in <APP_PATH>/src/app/components/<MY_COMPONENT> (8,26): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdDialogRef'.
ERROR in <APP_PATH> (11,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdButtonModule'.
ERROR in <APP_PATH> (11,19): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdCheckboxModule'.
ERROR in <APP_PATH> (11,37): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdToolbarModule'.
ERROR in <APP_PATH> (11,54): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdIconModule'.
ERROR in <APP_PATH> (11,68): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdCardModule'.
ERROR in <APP_PATH> (11,82): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdMenuModule'.
ERROR in <APP_PATH> (11,96): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdInputModule'.
ERROR in <APP_PATH> (12,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSidenavModule'.
ERROR in <APP_PATH> (12,20): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdRippleModule'.
ERROR in <APP_PATH> (12,36): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdRadioModule'.
ERROR in <APP_PATH> (12,51): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSliderModule'.
ERROR in <APP_PATH> (12,67): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdFormFieldModule'.
ERROR in <APP_PATH> (12,86): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSelectModule'.
ERROR in <APP_PATH> (13,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSlideToggleModule'.
ERROR in <APP_PATH> (13,24): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdDatepickerModule'.
ERROR in <APP_PATH>/src/app/components/<MY_COMPONENT> (8,26): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdDialog'.
ERROR in <APP_PATH> (13,64): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdAutocompleteModule'.
ERROR in <APP_PATH> (13,86): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdDialogModule'.
ERROR in <APP_PATH> (14,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdProgressBarModule'.
ERROR in <APP_PATH>/src/app/components/<MY_COMPONENT> (5,10): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSlideToggleChange'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdButtonModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,19): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdCheckboxModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,37): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdToolbarModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,54): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdIconModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,68): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdCardModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,82): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdMenuModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (2,96): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdInputModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,3): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSidenavModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,20): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdRippleModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,36): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdRadioModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,51): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSliderModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,67): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSelectModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,83): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdSlideToggleModule'.
ERROR in <APP_PATH>/src/app/components/components-test.module.ts (3,104): Module '"<APP_PATH>/node_modules/@angular/material/material"' has no exported member 'MdFormFieldModule'.
ERROR in Error: MdButtonModule is not an NgModule
    at _getNgModuleMetadata (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:140:15)
    at _extractLazyRoutesFromStaticModule (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
    at <APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27
    at Array.reduce (native)
    at _extractLazyRoutesFromStaticModule (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10)
    at <APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27
    at Array.reduce (native)
    at _extractLazyRoutesFromStaticModule (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10)
    at <APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27
    at Array.reduce (native)
    at _extractLazyRoutesFromStaticModule (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10)
    at Object.listLazyRoutesOfModule (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (<APP_PATH>\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (<APP_PATH>\node_modules\@ngtools\webpack\src\plugin.js:207:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (<APP_PATH>\node_modules\@ngtools\webpack\src\plugin.js:443:24)
    at process._tickCallback (internal/process/next_tick.js:103:7)

webpack: Failed to compile.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

100reactions
willshowellcommented, Oct 10, 2017

@devsull replace Md* with Mat* (see deprecation here)

43reactions
willshowellcommented, Oct 10, 2017

Did you both make the change from Md to Mat? If so, I’ve occasionally seen this before and it was always solved by blowing away node_modules and reinstalling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error : Module '"@angular/material"' has no exported member ...
And import the AngularMaterialModule to app.module.ts file but i have this error : Module '"@angular/material"' has no exported member "....
Read more >
Angular Material “has no exported member 'MaterialModule'”
a) There is no more MaterialModule. The idea being, you import what you need. This makes sense since as angular material is growing,...
Read more >
m getting a &#38;#039;has no exported member Conf
build process halts with ConfigurableFocusTrapFactory error ... angular/cdk/a11y"' has no exported member 'ConfigurableFocusTrapFactory'.
Read more >
angular/material2 - Gitter
morning, any ideas as to why I am getting ERROR in . ... node_modules/@angular/material/material"' has no exported member 'MdButtonModule'.
Read more >
error ts2305: module '"@angular/core"' has no exported ...
Error: node_modules/ngx-loadable/lib/loadable.service.d.ts:1:43 - error TS2305: Module '"@angular/core"' has no exported member 'NgModuleFactoryLoader'.
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