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.

Warning when building CLI app in prod mode for mat-menu

See original GitHub issue

after the update from angular material 5 to 6 when i try to build with “–prod” flag i give different warning such:

"export ‘MAT_FORM_FIELD_DEFAULT_OPTIONS’ (imported as ‘i9’) was not found in ‘@angular/material/form-field’

WARNING in ./node_modules/@angular/material/tabs/typings/index.ngfactory.js 153:374-400 "export ‘_MAT_INK_BAR_POSITIONER’ (imported as ‘i1’) was not found in ‘@angular/material/tabs’

WARNING in ./src/app/app.module.ngfactory.js 90:13675-13704 "export ‘MAT_CHIPS_DEFAULT_OPTIONS’ (imported as ‘i61’) was not found in ‘@angular/material/chips’

this make the page broken on the browser and not load at all, with: ERROR Error: StaticInjectorError[t -> t]: StaticInjectorError(Platform: core)[t -> t]: NullInjectorError: No provider for t!

if i switch back to older version of Angular Material seems all work fine.

PACKAGE.json

{
  "name": "iptvWeb",
  "version": "0.0.6",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.0",
    "@angular/cdk": "^6.0.1",
    "@angular/common": "6.0.0",
    "@angular/compiler": "6.0.0",
    "@angular/core": "6.0.0",
    "@angular/flex-layout": "github:angular/flex-layout-builds",
    "@angular/forms": "6.0.0",
    "@angular/http": "6.0.0",
    "@angular/material": "^6.0.1",
    "@angular/platform-browser": "6.0.0",
    "@angular/platform-browser-dynamic": "6.0.0",
    "@angular/router": "6.0.0",
    "@ng-bootstrap/ng-bootstrap": "^1.1.2",
    "@ngx-progressbar/core": "^4.3.0",
    "@ngx-progressbar/http": "^4.3.0",
    "@webcomponents/custom-elements": "^1.1.0",
    "ag-grid": "^17.1.1",
    "ag-grid-angular": "^17.1.0",
    "angular-font-awesome": "^3.1.2",
    "angular-in-memory-web-api": "^0.5.4",
    "angular2-virtual-scroll": "^0.3.2",
    "angularfire2": "^5.0.0-rc.5-next",
    "bootstrap": "^4.1.1",
    "core-js": "^2.5.6",
    "crypto-js": "^3.1.9-1",
    "dashjs": "^2.6.8",
    "firebase": "^4.13.1",
    "flex-layout-srcs": "5.0.0-beta.14",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "hls.js": "^0.8.9",
    "ng-sidebar": "^7.1.0",
    "ngx-flickity": "0.0.9",
    "ngx-infinite-scroll": "^0.8.4",
    "ngx-scrollbar": "^1.5.7",
    "promise-polyfill": "7.1.0",
    "rxjs": "^6.1.0",
    "rxjs-compat": "^6.1.0",
    "stream": "0.0.2",
    "timers": "^0.1.1",
    "videogular2": "^6.1.1",
    "xml2js": "^0.4.19",
    "xmltv": "^0.3.0",
    "xmltv-parser": "^1.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.0",
    "@angular/cli": "^6.0.0",
    "@angular/compiler-cli": "6.0.0",
    "@angular/language-service": "6.0.0",
    "@types/core-js": "^0.9.46",
    "@types/crypto-js": "^3.1.39",
    "@types/jasmine": "^2.8.7",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^6.0.109",
    "codelyzer": "^4.3.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.2",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "^1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.7.2"
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
cushercommented, Jul 26, 2018

From my own testing, things seems to works fine up to version 6.3.1 of @angular/material. If build-optimizer is enabled, things start to break in 6.3.2, then more breaks in 6.3.3. Tested with @angular-devkit 0.6.8 and webpack 4.8.3.

6.3.2 breaks the Moment date adapter Building gives a warning:

WARNING in ./src/app/app.module.ngfactory.js
156:4731-4766 "export 'MAT_MOMENT_DATE_ADAPTER_OPTIONS' (imported as 'i41') was not found in '@angular/material-moment-adapter'

With Chrome giving the error:

ERROR TypeError: Cannot read property 'ngInjectableDef' of undefined

6.3.3 additionally breaks menus: Build warning:

WARNING in ./src/app/app.module.ngfactory.js
156:4629-4637 "export 'ɵd23' (imported as 'i40') was not found in '@angular/material/menu'

Chrome error:

ERROR TypeError: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ɵnov(...)._getAriaLabel is not a function

UPDATE: This seems to have been a regression in angular-devkit somewhere between 0.6.3 and 0.6.8 that has since been fixed. Latest angular/material works fine for me after updating devkit to 0.7.1

1reaction
inthegaragecommented, Jul 30, 2018

@cusher Yes, moving to the 0.7.1 has fixed it also here. Frustrating. Thanks for the input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting some warning messages while building thr angular ...
I am getting the following error while building the angular application using the command ng build --prod . Error:
Read more >
ngx-mat-menu-group - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix ...
Read more >
Build Your First PWA with Angular - Okta Developer
This post shows you how to build a PWA (Progressive Web Application) with Angular, Angular CLI, and Angular Material.
Read more >
angular/angular - Gitter
hello, does anyone know if it is bad practice to use document.URL? I have a service to check for user information on my...
Read more >
@angular/material | Yarn - Package Manager
The Angular team builds and maintains both common UI components and tools to help you build your own custom components. The team maintains...
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