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.

Error running production build after upgrading to angular-cli 1.5

See original GitHub issue

Versions


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.5.0
Node: 8.9.0
OS: win32 x64
Angular: 5.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.0
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.36
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.5
typescript: 2.4.2
webpack: 3.8.1
Windows 10

Repro steps

  • run command ng build --prod --aot=false
  • deploy the output to a webserver
  • open page

Observed behavior

When opening the web page after deploying the production build I receive the error

Uncaught Error: Can't resolve all parameters for e: (?, ?, ?, ?).
    at c (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at t._getDependenciesMetadata (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at t._getTypeMetadata (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at t._getInjectableMetadata (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at t.getProviderMetadata (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at main.f351f1c9f54ee60a63a8.bundle.js:1
    at Array.forEach (<anonymous>)
    at t._getProvidersMetadata (main.f351f1c9f54ee60a63a8.bundle.js:1)
    at main.f351f1c9f54ee60a63a8.bundle.js:1
    at Array.forEach (<anonymous>)

Interesting is that when I run ng serve --aot=false the application is working as expected.

Desired behavior

Before the upgrade to angular 5 and angular cli 1.5 production builds were running without any problems. I am just wondering what is wrong now

Mention any other details that might be useful

the package.json looks like this:

{
  "name": "bmc-web-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build-onpremise": "ng build --environment onpremise",
    "build-prod": "ng build --environment prod",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:watchall": "jest --watchAll",
    "test:ci": "jest --runInBand",
    "test:coverage": "jest --coverage",
    "karma": "karma start karma.conf.js --browsers Chrome_with_debugging",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "json-server": "json-server --watch src/db/json-server-db.json --routes src/db/json-server-routes.json",
    "onpremise": "ng serve --environment onpremise",
    "node-watch": "nodemon --watch src/db/mocks src/db/json-server.js",
    "serve": "concurrently \"ng serve\" \"npm run node-watch\""
  },
  "jest": {
    "preset": "jest-preset-angular",
    "setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts",
    "transformIgnorePatterns": [
      "node_modules/(?!@ngrx|angular2-ui-switch)"
    ],
    "moduleNameMapper": {
      "@bremacon/beschaffungen/(.*)": "<rootDir>/src/app/features/beschaffungen/$1",
      "@bremacon/entnahmestellen/(.*)": "<rootDir>/src/app/features/entnahmestellen/$1",
      "@bremacon/importe/(.*)": "<rootDir>/src/app/features/importe/$1",
      "@bremacon/kunden/(.*)": "<rootDir>/src/app/features/kunden/$1",
      "@bremacon/lieferanten/(.*)": "<rootDir>/src/app/features/lieferanten/$1",
      "@bremacon/mandanten/(.*)": "<rootDir>/src/app/features/mandanten/$1",
      "@bremacon/modifikationen/(.*)": "<rootDir>/src/app/features/modifikationen/$1",
      "@bremacon/portfolios/(.*)": "<rootDir>/src/app/features/portfolios/$1",
      "@bremacon/vertraege/(.*)": "<rootDir>/src/app/features/vertraege/$1",
      "@bremacon/(.*)": "<rootDir>/src/app/$1"
    },
    "transform": {
      "^.+\\.(ts|js|html)$": "<rootDir>/node_modules/jest-preset-angular/preprocessor.js"
    },
    "moduleDirectories": [
      "node_modules",
      "<rootDir>/src"
    ],
    "globals": {
      "ts-jest": {
        "tsConfigFile": "./src/tsconfig.spec.json"
      },
      "__TRANSFORM_HTML__": true
    }
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "@angular/flex-layout": "^2.0.0-beta.10-4905443",
    "@angular/material": "5.0.0-rc0",
    "@angular/cdk": "5.0.0-rc0",
    "ngrx-forms": "^1.1.1",
    "@ngrx/effects": "^4.1.1",
    "@ngrx/entity": "^4.1.1",
    "@ngrx/router-store": "^4.1.1",
    "@ngrx/store": "^4.1.1",
    "@ngrx/store-devtools": "^4.1.1",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14",
    "bootstrap": "^4.0.0-beta",
    "d3": "4.9.1",
    "d3-selection-multi": "1.0.1",
    "file-saver": "^1.3.3",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.2.1",
    "json-server": "^0.12.0",
    "moment": "^2.18.1",
    "ng2-file-upload": "^1.2.0",
    "popper": "^1.0.0",
    "propper": "^1.0.2",
    "reselect": "^3.0.1",
    "roboto-fontface": "^0.8.0",
    "simplify-js": "^1.2.1",
    "tether": "^1.3.7",
    "angular2-moment": "^1.7.0",
    "text-encoding": "^0.6.4"
  },
  "devDependencies": {
    "@angular/cli": "1.5.0",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "@types/d3-array": "^1.0",
    "@types/d3-axis": "^1.0",
    "@types/d3-brush": "^1.0",
    "@types/d3-chord": "^1.0",
    "@types/d3-collection": "^1.0",
    "@types/d3-color": "^1.0",
    "@types/d3-dispatch": "^1.0",
    "@types/d3-drag": "^1.0",
    "@types/d3-dsv": "^1.0",
    "@types/d3-ease": "^1.0",
    "@types/d3-force": "^1.0",
    "@types/d3-format": "^1.0",
    "@types/d3-geo": "^1.2",
    "@types/d3-hierarchy": "^1.0",
    "@types/d3-interpolate": "^1.1",
    "@types/d3-path": "^1.0.5",
    "@types/d3-polygon": "^1.0",
    "@types/d3-quadtree": "^1.0",
    "@types/d3-queue": "^3.0",
    "@types/d3-random": "^1.0",
    "@types/d3-scale": "^1.0.8",
    "@types/d3-selection": "^1.0.5",
    "@types/d3-selection-multi": "^1.0.5",
    "@types/d3-shape": "^1.0",
    "@types/d3-time": "^1.0.5",
    "@types/d3-time-format": "2.0.4",
    "@types/d3-timer": "^1.0",
    "@types/d3-transition": "^1.0",
    "@types/d3-voronoi": "^1.0",
    "@types/d3-zoom": "1.2.0",
    "@types/jest": "^21.1.5",
    "codelyzer": "~3.2.1",
    "concurrently": "^3.5.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "jest": "^21.2.1",
    "jest-preset-angular": "^4.0.1",
    "jest-zone-patch": "^0.0.8",
    "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",
    "protractor": "~5.1.2",
    "ts-jest": "^21.1.3",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "2.4.2"
  }
}

I already googled for this issue. Some issues state that this can be caused by circular dependencies which is not the case (at least the cli is not showing any warning). Any help would be appreciated.

Thanks in advance.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
alsamicommented, Nov 23, 2017

Hey @filipesilva cool, ty! Will do so tonight and let you know when I am done.

1reaction
filipesilvacommented, Nov 23, 2017

Heya, I’d like to look into this but really need a repro I can tinker with.

Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading Angular project from 9.1.12 to 14.0.6 have build ...
I have used the update guide and followed the steps one version at a time. removed node_modules and installed packages again. as I...
Read more >
Deployment
When you are ready to deploy your Angular application to a remote server, you have various options for deployment. Simple deployment optionslink.
Read more >
Angular CLI - codecraft.tv
This builds our project and then runs all the tests, any errors are output to the terminal. This command also watches for any...
Read more >
Angular CLI - ng build Command
Sr.No. Option & Syntax Description 2 ‑‑baseHref=baseHref Base url for the application being built. 9 ‑‑deployUrl=deployUrl URL where files will be deployed. 17 ‑‑localize=true|false
Read more >
Angular Service Worker - Step-By-Step Guide
In this post, we will cover how we can configure the Angular CLI build pipeline to generate applications that in production mode are ......
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