-
Notifications
You must be signed in to change notification settings - Fork 12k
ng build --prod --aot not working #5802
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
Comments
Juste remove Why angular-cli set |
I removed and had the same issue. :( |
can you show us your main.ts file ? |
Sure
|
i just noticed a thing, in your "tsconfig.app.json" you have: "**/*.spec.ts" in both include and exclude. try remove it from the include object and try again. it might not solve the problem but it seems wrong to me. |
Yep same here, just upgraded from angular 2 to angular 4 everything works except when I use the --aot command I get this: ERROR in Child compilation failed:
|
I removed |
I had the same types of issues as @insta-code1 and @luishmcmoreno when trying to upgrade to v4.0.0. Can run ng serve but cannot build with AOT |
which version of TypeScript are you using @luishmcmoreno and @insta-code1 ? |
2.2.0 here. |
This seems to be happening outside of the CLI as well, with |
currently facing issues like angular/angular-cli#5802 cannot find browser-app.module.ngfactory
Hi I have the same issue, is there a workaround ? UPDATE: just created a "fresh" app with |
Hello.
dependencies:
devDependencies:
This error heapen only with Angular 4 and keys "--prod --aot". How to fix this? |
@mcosta74 try to add a type |
* wip - aot upgrade currently facing issues like angular/angular-cli#5802 cannot find browser-app.module.ngfactory * feat(AoT): ✨ ✨ added initial AoT support any many other things Added Bootstrap with SCSS / SASS support Added ng2-bootstrap Passing Server originURL so that URLs can use it (when 4.1 comes out with HttpInterceptors this will be even easier to do) ✨ AoT added ! for prod (npm run build:aot) - Still need to test this for Azure deployments etc Removed es6-shim added core-js
@luishmcmoreno tried also if I don't really understand why this should have effect. nothing changed. Thanks anyway |
You need to use the type in the code. try in app.component using: If you put:
in tsconfig.app.json the error disappears but |
Hey guys. Thank you everyone. The "include" property at tsconfig.app.json was totally unnecessary and I had to include each @types I had added at "files" property inside "compilerOptions" and now I can build with --prod flag. The problem was I had added "google.maps" but the "@types" is "googlemaps". |
Small Update I'm still not understanding where is the problem but when I run
it works and the size of the generated code is about 70% smaller than the normal one |
@mcosta74 That just disables AOT - the app is 'smaller than the normal one' because a prod build does other stuff, minification etc. |
@davidstellini I know that. At the moment I was mainly interested to reduce the size of the build. SO for now it's ok. Anyway my guess is that the guilty is Bootstrap Alpha and/or ng-bootstrap |
Closing as @luishmcmoreno seems to have his problem sorted. Thanks to everyone that helped out! |
same problem : I don't see relation with the bug ??? |
main.ts -> wrong path : import { environment } from './environments/environment'; |
Running ng build -prod i'm getting the following error:
cli: The problem seems to be with AOT |
@Hosar upgrade to 1.3.1 the latest and it should work fine. |
when i finish ng build --prod ,i get some js file like this main.65413sdfs156432dfdfaf.bundle.js. what's this?? how can i get file like main.bundle.js??what should i do ?? |
@gavinsui look this http://prntscr.com/glv1j9 |
* wip - aot upgrade currently facing issues like angular/angular-cli#5802 cannot find browser-app.module.ngfactory * feat(AoT): ✨ ✨ added initial AoT support any many other things Added Bootstrap with SCSS / SASS support Added ng2-bootstrap Passing Server originURL so that URLs can use it (when 4.1 comes out with HttpInterceptors this will be even easier to do) ✨ AoT added ! for prod (npm run build:aot) - Still need to test this for Azure deployments etc Removed es6-shim added core-js
Hi, can you help me too? roolup-config.js export default {
}, "files": [ "angularCompilerOptions": { |
@gavinsui Use:
to remove, but remove only if you are aware of the implications. Then for Cordova / ionic for example you can use:
My opinion... Until someone can teach us more about it.. : I hope I have helped. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
and then, change the tsconfig.app.json to:
if we did not change this file, ng serve fails to provide the google type:
Cannot find namespace 'google'
. Without this change, the ng build --prod --aot works.The log given by the failure.
The text was updated successfully, but these errors were encountered: