Skip to content

ng build works fine, but ng build --prod fails #6091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shoebsd31 opened this issue Apr 26, 2017 · 3 comments
Closed

ng build works fine, but ng build --prod fails #6091

shoebsd31 opened this issue Apr 26, 2017 · 3 comments

Comments

@shoebsd31
Copy link

shoebsd31 commented Apr 26, 2017

I get the following error :

**ERROR in Can't resolve all parameters for UserApi in E:/Source/Dev/Frontend2/src/app/services/api/UserApi.ts: ([object Object], ?).

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'E:\Source\Dev\Frontend2\src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts**

Everything works fine on ng --build and ng --serve.

I am not able to understand what does it do differently in --prod that it is throwing such error.

Also I checked UserApi.ts, which looks perfectly fine to me

my package.json is as follows :

{ "name": "demo-client", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "build": "ng build --prod", "start": "ng serve --sourcemap --host localhost --port 8000", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" }, "private": true, "dependencies": { "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "@angular/core": "^4.0.1", "@angular/forms": "^4.0.1", "@angular/http": "^4.0.1", "@angular/platform-browser": "^4.0.1", "@angular/platform-browser-dynamic": "^4.0.1", "@angular/platform-server": "^4.0.1", "@angular/router": "^4.0.1", "angular-in-memory-web-api": "~0.2.4", "core-js": "^2.4.1", "ng2-accordion": "0.0.15", "ng2-bootstrap": "^1.4.2", "rxjs": "5.0.1", "systemjs": "0.19.40", "typescript": "^2.2.2", "zone.js": "^0.7.4" }, "devDependencies": { "@angular/cli": "^1.0.0", "@angular/compiler-cli": "4.0.0", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "lodash": "^4.16.4", "protractor": "~4.0.13", "rimraf": "^2.5.4", "ts-node": "1.2.1", "tslint": "^4.3.0", "typescript": "~2.0.3" } }

I am using angular/cli version 1.0.0 and node : 7.7.2

@rochapablo
Copy link

rochapablo commented Apr 26, 2017

I'm not sure if (Gbuomprisco/ngx-chips#345 (comment)) could be related.

But running locally works fine, but not when I build the application at Heroku.

"heroku-postbuild": "ng build --prod"

I still trying to understand where exactly it's the problem.

...

#6020

@filipesilva
Copy link
Contributor

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-cli.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants