Topic: building a project including mdb pro for production with AoT enabled fails

rernens pro asked 6 years ago


When building an angular 6 project including MDB Pro 6.1.1 downloaded through the zip and installed in the project as per the downloaded project, the build fails if AoT enabled : ERROR in ./ng-uikit-pro-standard/ng-uikit-pro-standard.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in '/Users/rer/Documents/Private/Angular Applications/InfoDecision/InfoAlloc/ng-uikit-pro-standard' Same error is thrown for each module that make use of MDB When building with ng-uikit-pro-standard stored in node_modules directory, the build fails with TS2307: Cannot find module 'ng-uikit-pro-standard'. for each modules where
import { MDBBootstrapModulesPro } from 'ng-uikit-pro-standard';

is used as per the migration guide.

rernens pro answered 6 years ago


Damian, I got access to gitlab. I have made a clean install using npm and got it to compile without problems apart dependencies warnings : warning " >ng-uikit-pro-standard@6.1.1" has incorrect peer dependency "@angular/core@^5.0.0". warning " > ng-uikit-pro-standard@6.1.1" has incorrect peer dependency "@angular/common@^5.0.0". warning " > ng-uikit-pro-standard@6.1.1" has incorrect peer dependency "@angular/http@^5.0.0".   Thanks

Damian Gemza staff commented 6 years ago

Dear remens, That's only warnings. You don't need to worry about them. We'll try to fix it in next release. Best Regards, Damian

rernens pro answered 6 years ago


Dear Damian, I requested an access to your gitlab but dit not get a response to my two requests so far. I tried with the ng-uikit-pro standard as a separate directory in the project folder at the same level as the node_modules directory and I tried with the directory inside the node_modules directory through a manual installation. I am using MDB Angular 6.1.1,  Node 9.7.1, Angular 6.0.3, under MacOS X 10.13.3
{
  "name": "info-alloc",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --open --source-map",
    "prod": "ng serve --prod --source-map --open",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.3",
    "@angular-devkit/core": "^0.6.5",
    "@angular-devkit/schematics": "^0.6.5",
    "@angular/animations": "^6.0.3",
    "@angular/cdk": "^6.1.0",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.1.0",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@ng-dynamic-forms/core": "^6.0.3",
    "@ng-dynamic-forms/ui-material": "^6.0.3",
    "@ngrx/effects": "^6.0.1",
    "@ngrx/entity": "^6.0.1",
    "@ngrx/router-store": "^6.0.1",
    "@ngrx/store": "^6.0.1",
    "@ngrx/store-devtools": "^6.0.1",
    "@ngx-translate/core": "^9.1.1",
    "@ngx-translate/http-loader": "^2.0.1",
    "angular2-text-mask": "^8.0.4",
    "angulartics2": "^6.1.0",
    "chart.js": "^2.7.2",
    "classlist": "^1.0.1",
    "core-js": "^2.5.7",
    "easy-pie-chart": "^2.1.7",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "lodash": "4.17.4",
    "ng-event-source": "^1.0.10",
    "ng-uikit-pro-standard": "^6.1.1",
    "ngrx-store-logger": "^0.2.1",
    "ngx-pagination": "^3.1.1",
    "ngx-quill": "^3.1.0",
    "quill-image-resize-module": "^3.0.0",
    "rxjs": "^6.2.0",
    "rxjs-compat": "^6.0.0-rc.0",
    "screenfull": "^3.3.2",
    "socket.io-client": "^2.1.0",
    "uuid": "^3.2.1",
    "wakanda-client": "^2.0.0",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.5",
    "@angular/cli": "^6.0.5",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@angularclass/hmr": "^2.1.3",
    "@ngrx/schematics": "^6.0.1",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2"
  }
}
Please provide access to your gitlab as requested so that I can install mdb through npm and see if the problem persists   Regards, Robert

Damian Gemza staff answered 6 years ago


Dear remens, Which version of MDB Angular you're using? From zip or from gitlab? I've tried to reproduce your case on zip version, but for me, everything is working just fine. Checked in zip version with import from root directory/ng-uikit-pro-standard:
import { MDBBootstrapModulesPro, MDBSpinningPreloader } from './../../ng-uikit-pro-standard';
Also tried with package installed from our gitlab repo:
import { MDBBootstrapModulesPro, MDBSpinningPreloader } from 'ng-uikit-pro-standard';
I've used below commands to check the problem:
ng build --prod,

ng build --aot,

ng build --prod --aot
And as I said before, I'm unable to reproduce your problem. Could you please provide me reproduction steps? And also your environment informations: MDB Angular version, Node version, Angular version, OS. Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags