Unable to build for production project with MDB


Topic: Unable to build for production project with MDB

RazakAlpha pro asked 6 years ago

I have project i created with Mdb 6.1.5 using the zip package. project works fine on dev machine using ng Serve. Howerver building the app with ng build --prod fails with the following errors ERROR in ./ng-uikit-pro-standard/ng-uikit-pro-standard.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamsng-uikit-pro-standard' ERROR in ./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcapp' ERROR in ./src/app/article/article.module.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcapparticle' ERROR in ./src/app/auth/auth.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappauth' ERROR in ./src/app/course/course-details/course-details.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappcoursecourse-details' ERROR in ./src/app/editor/editor.module.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappeditor' ERROR in ./src/app/institutions/institutions-details/institutions-details.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappinstitutionsinstitutions-details' ERROR in ./src/app/profile/profile.module.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappprofile' ERROR in ./src/app/questions/answer/answer.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappquestionsanswer' ERROR in ./src/app/questions/question/question.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappquestionsquestion' ERROR in ./src/app/questions/questions/questions.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappquestionsquestions' ERROR in ./src/app/quiz/quiz/quiz.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappquizquiz' ERROR in ./src/app/quiz/quizes/quizes.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappquizquizes' ERROR in ./src/app/settings/settings.module.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappsettings' ERROR in ./src/app/shared/layout/header.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappsharedlayout' ERROR in ./src/app/shared/layout/control-quiz-editor/control-quiz-editor.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappsharedlayoutcontrol-quiz-editor' ERROR in ./src/app/shared/layout/students-browser/students-browser.component.ngfactory.js Module not found: Error: Can't resolve 'ng-uikit-pro-standard' in 'D:PROGRAMMING_STUFFSangularjsnestExamssrcappsharedlayoutstudents-browser'

Damian Gemza staff commented 6 years ago

Dear Razak, I have tried to reproduce your case, but for me everything is working fine. Could you please show me your package.json file, app.module.ts file (or another module in which you're importing MDB Angular modules)? It would help me to debug your problem. Best Regards, Damian

RazakAlpha pro answered 6 years ago

Package.json file

{
"name": "ang2-conduit",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod --bh ./ && cp CNAME dist/CNAME",
"test": "ng test",
"lint": "ng lint --force",
"e2e": "ng e2e"
},
"pre-commit": [
"lint"
],
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.2",
"@angular/animations": "5.2.9",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/router": "5.2.9",
"angular-datetime-inputs": "^0.2.6",
"chart.js": "2.5.x",
"classlist.js": "1.1.x",
"core-js": "^2.4.1",
"easy-pie-chart": "2.1.x",
"font-awesome": "4.7.x",
"hammerjs": "2.0.x",
"jarallax": "^1.10.3",
"marked": "^0.3.9",
"ng-html-util": "1.0.x",
"primeng": "^6.0.0-alpha.1",
"quill": "^1.3.6",
"rxjs": "^5.5.8",
"screenfull": "3.3.x",
"smoothscroll-polyfill": "0.3.x",
"web-animations-js": "2.3.x",
"webpack": "^3.11.0",
"zone.js": "^0.8.25"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.5.0",
"@angular/cli": "^1.7.3",
"@angular/compiler-cli": "5.2.9",
"@angular/language-service": "5.2.9",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^9.4.0",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"pre-commit": "^1.2.2"
}
}

APPMODULE

import { ModuleWithProviders, NgModule, NO_ERRORS_SCHEMA, enableProdMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { AuthModule } from './auth/auth.module';
import { HomeModule } from './home/home.module';
import {
FooterComponent,
HeaderComponent,
SharedModule
} from './shared';
import { AppRoutingModule } from './app-routing.module';
import { CoreModule } from './core/core.module';
import { InstitutionsModule } from './institutions/institutions.module';
import { ChipsModule} from 'primeng/chips'
import { ProfileModule } from './profile/profile.module';
import { FileUploadModule} from 'primeng/fileupload'
import { CourseModule } from './course/course.module';
import { QuestionsModule } from './questions/questions.module';
import { QuizModule } from './quiz/quiz.module';
import { TabsModule, DropdownModule, SelectModule, NavbarModule, CollapseModule } from '../../ng-uikit-pro-standard/ng-uikit-pro-standard';
@NgModule({
declarations: [AppComponent, FooterComponent, HeaderComponent],
imports: [
BrowserModule,
CoreModule,
SharedModule,
HomeModule,
AuthModule,
AppRoutingModule,AuthModule,
DropdownModule.forRoot(),
NavbarModule,
InstitutionsModule, CourseModule, QuestionsModule,
ChipsModule,
ProfileModule,
FileUploadModule, QuizModule, TabsModule.forRoot()
],
providers: [],
bootstrap: [AppComponent],
schemas:[NO_ERRORS_SCHEMA]
})
export class AppModule {}

Damian Gemza staff commented 6 years ago

Could you please try to import MDB modules not from './../ng-uikit-pro-standard/ng-uikit-pro-standard/' but from /./../ng-uikit-pro-standard' or from 'ng-uikit-pro-standard' (installed in node_modules) and let me know if errors still exists? 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
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No