Angular Uncaught TypeError: e is not a constructor after build --prod (work on ng serve)











up vote
0
down vote

favorite












I have a problem while uploading my angular application to production .
The application works just fine in development and used to work before on production too.



To build my application I'm using:



ng build --prod --base-href="/site/" 


The application is built, but with the following warnings:



WARNING in ./src/app/eco-header/eco-header.component.ngfactory.js 138:299-319 "export 'MAT_ICON_LOCATION' (imported as 'i9') was not found in '@angular/material/icon'

WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1247-1265 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1267-1285 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

WARNING in ./node_modules/@angular/material/icon/typings/index.ngfactory.js 20:327-347 "export 'MAT_ICON_LOCATION' (imported as 'i1') was not found in '@angular/material/icon'


When I try to load the page, I get the following error:



Uncaught TypeError: e is not a constructor
at main.1ebe20842d3713f62535.js:1
at Wl (main.1ebe20842d3713f62535.js:1)
at main.1ebe20842d3713f62535.js:1
at new t (main.1ebe20842d3713f62535.js:1)
at Object.dr [as createNgModuleRef] (main.1ebe20842d3713f62535.js:1)
at e.create (main.1ebe20842d3713f62535.js:1)
at main.1ebe20842d3713f62535.js:1
at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)
at Object.onInvoke (main.1ebe20842d3713f62535.js:1)
at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)


My tsconfig:



{
"compilerOptions": {
"experimentalDecorators": true,
"allowJs": true,
"sourceMap": true
}
}


My package.json:



{   "name": "idea-ecomanager-frontend",   "version": "0.0.0",   "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e" }, "private": true, "dependencies": {
"@angular/animations": "^7.0.1",
"@angular/cdk": "^7.0.2",
"@angular/common": "^7.0.1",
"@angular/compiler": "^7.0.1",
"@angular/core": "^7.0.1",
"@angular/forms": "^7.0.1",
"@angular/http": "^7.0.1",
"@angular/material": "^7.0.2",
"@angular/platform-browser": "^7.0.1",
"@angular/platform-browser-dynamic": "^7.0.1",
"@angular/router": "^7.0.1",
"angularcli": "^6.0.1",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"ngx-loading": "^3.0.1",
"ngx-toastr": "^9.1.1",
"rxjs": "^6.3.3",
"zone.js": "^0.8.26" }, "devDependencies": {
"@angular-devkit/build-angular": "~0.6.0",
"@angular/cli": "^6.0.8",
"@angular/compiler-cli": "^7.0.1",
"@angular/language-service": "^7.0.1",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~3.1.3" } }


Any idea why this is happening?










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have a problem while uploading my angular application to production .
    The application works just fine in development and used to work before on production too.



    To build my application I'm using:



    ng build --prod --base-href="/site/" 


    The application is built, but with the following warnings:



    WARNING in ./src/app/eco-header/eco-header.component.ngfactory.js 138:299-319 "export 'MAT_ICON_LOCATION' (imported as 'i9') was not found in '@angular/material/icon'

    WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1247-1265 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

    WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1267-1285 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

    WARNING in ./node_modules/@angular/material/icon/typings/index.ngfactory.js 20:327-347 "export 'MAT_ICON_LOCATION' (imported as 'i1') was not found in '@angular/material/icon'


    When I try to load the page, I get the following error:



    Uncaught TypeError: e is not a constructor
    at main.1ebe20842d3713f62535.js:1
    at Wl (main.1ebe20842d3713f62535.js:1)
    at main.1ebe20842d3713f62535.js:1
    at new t (main.1ebe20842d3713f62535.js:1)
    at Object.dr [as createNgModuleRef] (main.1ebe20842d3713f62535.js:1)
    at e.create (main.1ebe20842d3713f62535.js:1)
    at main.1ebe20842d3713f62535.js:1
    at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)
    at Object.onInvoke (main.1ebe20842d3713f62535.js:1)
    at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)


    My tsconfig:



    {
    "compilerOptions": {
    "experimentalDecorators": true,
    "allowJs": true,
    "sourceMap": true
    }
    }


    My package.json:



    {   "name": "idea-ecomanager-frontend",   "version": "0.0.0",   "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e" }, "private": true, "dependencies": {
    "@angular/animations": "^7.0.1",
    "@angular/cdk": "^7.0.2",
    "@angular/common": "^7.0.1",
    "@angular/compiler": "^7.0.1",
    "@angular/core": "^7.0.1",
    "@angular/forms": "^7.0.1",
    "@angular/http": "^7.0.1",
    "@angular/material": "^7.0.2",
    "@angular/platform-browser": "^7.0.1",
    "@angular/platform-browser-dynamic": "^7.0.1",
    "@angular/router": "^7.0.1",
    "angularcli": "^6.0.1",
    "bootstrap": "^4.1.3",
    "core-js": "^2.5.4",
    "ngx-loading": "^3.0.1",
    "ngx-toastr": "^9.1.1",
    "rxjs": "^6.3.3",
    "zone.js": "^0.8.26" }, "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.0",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^7.0.1",
    "@angular/language-service": "^7.0.1",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~3.1.3" } }


    Any idea why this is happening?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a problem while uploading my angular application to production .
      The application works just fine in development and used to work before on production too.



      To build my application I'm using:



      ng build --prod --base-href="/site/" 


      The application is built, but with the following warnings:



      WARNING in ./src/app/eco-header/eco-header.component.ngfactory.js 138:299-319 "export 'MAT_ICON_LOCATION' (imported as 'i9') was not found in '@angular/material/icon'

      WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1247-1265 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

      WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1267-1285 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

      WARNING in ./node_modules/@angular/material/icon/typings/index.ngfactory.js 20:327-347 "export 'MAT_ICON_LOCATION' (imported as 'i1') was not found in '@angular/material/icon'


      When I try to load the page, I get the following error:



      Uncaught TypeError: e is not a constructor
      at main.1ebe20842d3713f62535.js:1
      at Wl (main.1ebe20842d3713f62535.js:1)
      at main.1ebe20842d3713f62535.js:1
      at new t (main.1ebe20842d3713f62535.js:1)
      at Object.dr [as createNgModuleRef] (main.1ebe20842d3713f62535.js:1)
      at e.create (main.1ebe20842d3713f62535.js:1)
      at main.1ebe20842d3713f62535.js:1
      at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)
      at Object.onInvoke (main.1ebe20842d3713f62535.js:1)
      at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)


      My tsconfig:



      {
      "compilerOptions": {
      "experimentalDecorators": true,
      "allowJs": true,
      "sourceMap": true
      }
      }


      My package.json:



      {   "name": "idea-ecomanager-frontend",   "version": "0.0.0",   "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e" }, "private": true, "dependencies": {
      "@angular/animations": "^7.0.1",
      "@angular/cdk": "^7.0.2",
      "@angular/common": "^7.0.1",
      "@angular/compiler": "^7.0.1",
      "@angular/core": "^7.0.1",
      "@angular/forms": "^7.0.1",
      "@angular/http": "^7.0.1",
      "@angular/material": "^7.0.2",
      "@angular/platform-browser": "^7.0.1",
      "@angular/platform-browser-dynamic": "^7.0.1",
      "@angular/router": "^7.0.1",
      "angularcli": "^6.0.1",
      "bootstrap": "^4.1.3",
      "core-js": "^2.5.4",
      "ngx-loading": "^3.0.1",
      "ngx-toastr": "^9.1.1",
      "rxjs": "^6.3.3",
      "zone.js": "^0.8.26" }, "devDependencies": {
      "@angular-devkit/build-angular": "~0.6.0",
      "@angular/cli": "^6.0.8",
      "@angular/compiler-cli": "^7.0.1",
      "@angular/language-service": "^7.0.1",
      "@types/jasmine": "~2.8.6",
      "@types/jasminewd2": "~2.0.3",
      "@types/node": "~8.9.4",
      "codelyzer": "~4.2.1",
      "jasmine-core": "~2.99.1",
      "jasmine-spec-reporter": "~4.2.1",
      "karma": "~1.7.1",
      "karma-chrome-launcher": "~2.2.0",
      "karma-coverage-istanbul-reporter": "~1.4.2",
      "karma-jasmine": "~1.1.1",
      "karma-jasmine-html-reporter": "^0.2.2",
      "protractor": "~5.3.0",
      "ts-node": "~5.0.1",
      "tslint": "~5.9.1",
      "typescript": "~3.1.3" } }


      Any idea why this is happening?










      share|improve this question















      I have a problem while uploading my angular application to production .
      The application works just fine in development and used to work before on production too.



      To build my application I'm using:



      ng build --prod --base-href="/site/" 


      The application is built, but with the following warnings:



      WARNING in ./src/app/eco-header/eco-header.component.ngfactory.js 138:299-319 "export 'MAT_ICON_LOCATION' (imported as 'i9') was not found in '@angular/material/icon'

      WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1247-1265 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

      WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1267-1285 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'

      WARNING in ./node_modules/@angular/material/icon/typings/index.ngfactory.js 20:327-347 "export 'MAT_ICON_LOCATION' (imported as 'i1') was not found in '@angular/material/icon'


      When I try to load the page, I get the following error:



      Uncaught TypeError: e is not a constructor
      at main.1ebe20842d3713f62535.js:1
      at Wl (main.1ebe20842d3713f62535.js:1)
      at main.1ebe20842d3713f62535.js:1
      at new t (main.1ebe20842d3713f62535.js:1)
      at Object.dr [as createNgModuleRef] (main.1ebe20842d3713f62535.js:1)
      at e.create (main.1ebe20842d3713f62535.js:1)
      at main.1ebe20842d3713f62535.js:1
      at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)
      at Object.onInvoke (main.1ebe20842d3713f62535.js:1)
      at e.invoke (polyfills.c72d3210425a88b28b6d.js:1)


      My tsconfig:



      {
      "compilerOptions": {
      "experimentalDecorators": true,
      "allowJs": true,
      "sourceMap": true
      }
      }


      My package.json:



      {   "name": "idea-ecomanager-frontend",   "version": "0.0.0",   "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e" }, "private": true, "dependencies": {
      "@angular/animations": "^7.0.1",
      "@angular/cdk": "^7.0.2",
      "@angular/common": "^7.0.1",
      "@angular/compiler": "^7.0.1",
      "@angular/core": "^7.0.1",
      "@angular/forms": "^7.0.1",
      "@angular/http": "^7.0.1",
      "@angular/material": "^7.0.2",
      "@angular/platform-browser": "^7.0.1",
      "@angular/platform-browser-dynamic": "^7.0.1",
      "@angular/router": "^7.0.1",
      "angularcli": "^6.0.1",
      "bootstrap": "^4.1.3",
      "core-js": "^2.5.4",
      "ngx-loading": "^3.0.1",
      "ngx-toastr": "^9.1.1",
      "rxjs": "^6.3.3",
      "zone.js": "^0.8.26" }, "devDependencies": {
      "@angular-devkit/build-angular": "~0.6.0",
      "@angular/cli": "^6.0.8",
      "@angular/compiler-cli": "^7.0.1",
      "@angular/language-service": "^7.0.1",
      "@types/jasmine": "~2.8.6",
      "@types/jasminewd2": "~2.0.3",
      "@types/node": "~8.9.4",
      "codelyzer": "~4.2.1",
      "jasmine-core": "~2.99.1",
      "jasmine-spec-reporter": "~4.2.1",
      "karma": "~1.7.1",
      "karma-chrome-launcher": "~2.2.0",
      "karma-coverage-istanbul-reporter": "~1.4.2",
      "karma-jasmine": "~1.1.1",
      "karma-jasmine-html-reporter": "^0.2.2",
      "protractor": "~5.3.0",
      "ts-node": "~5.0.1",
      "tslint": "~5.9.1",
      "typescript": "~3.1.3" } }


      Any idea why this is happening?







      angular typescript angular-cli






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 at 19:00









      Worthwelle

      424111




      424111










      asked Nov 21 at 18:50









      Or Yaacov

      543111




      543111





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418760%2fangular-uncaught-typeerror-e-is-not-a-constructor-after-build-prod-work-on-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418760%2fangular-uncaught-typeerror-e-is-not-a-constructor-after-build-prod-work-on-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What visual should I use to simply compare current year value vs last year in Power BI desktop

          How to ignore python UserWarning in pytest?

          Alexandru Averescu