Skip to content

build on angular 5 with errors for production but developer mode works fine #8444

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
1 of 2 tasks
Widrogo opened this issue Nov 10, 2017 · 13 comments
Closed
1 of 2 tasks

Comments

@Widrogo
Copy link

Widrogo commented Nov 10, 2017

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

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

angular/cli: 1.5.0
angular-devkit/build-optimizer: 0.0.32
angular-devkit/core: 0.0.20
angular-devkit/schematics: 0.0.35
ngtools/json-schema: 1.1.0
ngtools/webpack: 1.8.0
schematics/angular: 0.1.2
typescript: 2.4.2
webpack: 3.8.1

Repro steps.

https://github.com/Widrogo/cakephp3-angular5

The project is quite new I just put a template, change what is necessary to use it with angular 5 and with ng serve me it runs without any error.

When I made the build for production it generates errors, it is because I use a modified modernizr script cakephp3-angular5/src/assets/js/modernizr.custom.32033.js it is just declared on angular-cli.json

Uncaught TypeError: Cannot read property 'html5' of undefined
at scripts.b43496ed343a01b5b3b7.bundle.js:11
at scripts.b43496ed343a01b5b3b7.bundle.js:11
at scripts.b43496ed343a01b5b3b7.bundle.js:11

I'm sure that the build causes problems because this is the only file that I handle html5 and debugging is the error here when I run the build.

For build test with different commands:

ng build --prod
ng build --prod --aot
ng build --prod --aot
ng build --prod --aot --base-href ./

And test the app with this:
ng serve --prod
give the same error that build for produccion

The log given by the failure.

Desired functionality.

I just want the build to work or production mode where it fails

Mention any other details that might be useful.

I'm using a modernzr modefied
https://stackoverflow.com/questions/47226546/modernizr-with-the-build-on-angular-5

@filipesilva filipesilva added needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix labels Dec 7, 2017
@monoflash
Copy link

+1

On my project, In the production mode, all forms, made on the basis of FormControl FormGroup, don't working, without error, returning empty values.

It is very shame to do not test the angular before publishing to the world!

@gozzoo
Copy link

gozzoo commented Jan 11, 2018

+1 with angular 5.2 - forms have empty values

@monoflash, have you found a workaround?

@tonype
Copy link

tonype commented Jan 12, 2018

@gozzoo What version is your CLI? Just ran into this, updating to CLI 1.6.4 seemed to fix it.

@gozzoo
Copy link

gozzoo commented Jan 13, 2018

@monoflash yes for me too. thanks anyways.

@janosfarkas
Copy link

+1
in development mode everything works fine, but in production some pages doesn't render, and it prints out to the console this:

ERROR Error: Uncaught (in promise): TypeError: I.a.merge is not a function

TypeError: I.a.merge is not a function
    at n.init (main.d43128a28b4131a72b5b.bundle.js:1)
    at new n (main.d43128a28b4131a72b5b.bundle.js:1)
    at co (main.d43128a28b4131a72b5b.bundle.js:1)
    at io (main.d43128a28b4131a72b5b.bundle.js:1)
    at Uo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Qo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Zo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Uo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Qo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Zo (main.d43128a28b4131a72b5b.bundle.js:1)
    at n.init (main.d43128a28b4131a72b5b.bundle.js:1)
    at new n (main.d43128a28b4131a72b5b.bundle.js:1)
    at co (main.d43128a28b4131a72b5b.bundle.js:1)
    at io (main.d43128a28b4131a72b5b.bundle.js:1)
    at Uo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Qo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Zo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Uo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Qo (main.d43128a28b4131a72b5b.bundle.js:1)
    at Zo (main.d43128a28b4131a72b5b.bundle.js:1)
    at v (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at v (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at polyfills.9f81ca5a629ad134b6f8.bundle.js:1
    at t.invokeTask (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at Object.onInvokeTask (main.d43128a28b4131a72b5b.bundle.js:1)
    at t.invokeTask (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at n.runTask (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at h (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at n.invokeTask [as invoke] (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
    at f (polyfills.9f81ca5a629ad134b6f8.bundle.js:1)
In @ main.d43128a28b4131a72b5b.bundle.js:1

@Bulinlinbu
Copy link

+1
Basic TypeErrors like :
ERROR in src\app\app.component.html(1,8): : Property '_connected' is protected and only accessible within class 'AppComponent' and its subclasses.
appear only when build prod

CLI 1.6.4

Same thing happen before in #5620 ?

@AlainLavoie1
Copy link

AlainLavoie1 commented Jan 26, 2018

+1
in development mode everything works fine, but in production pages doesn't render all, and it prints out to the console this:

ERROR TypeError: T.a.merge is not a function
    at e.subscribeEvents (0.f529074cf8b4f36dbf99.chunk.js:1)
    at new e (0.f529074cf8b4f36dbf99.chunk.js:1)
    at vo (main.372a11c5aeacdc513273.bundle.js:1)
    at fo (main.372a11c5aeacdc513273.bundle.js:1)
    at Ko (main.372a11c5aeacdc513273.bundle.js:1)
    at Object.Ho [as createEmbeddedView] (main.372a11c5aeacdc513273.bundle.js:1)
    at t.createEmbeddedView (main.372a11c5aeacdc513273.bundle.js:1)
    at e.createEmbeddedView (main.372a11c5aeacdc513273.bundle.js:1)
    at e._updateView (main.372a11c5aeacdc513273.bundle.js:1)
    at e.set [as ngIf] (main.372a11c5aeacdc513273.bundle.js:1)

*** Found out my error was related to RxJS 5.5 and higher with Kendo-ui for angular
https://github.com/telerik/kendo-angular/issues/1244

@filipesilva filipesilva added comp: cli/build and removed needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix labels Feb 14, 2018
@ghost
Copy link

ghost commented Jul 5, 2018

Same thing for me. No error while in dev mod, but when i try to build i got a lot of errors that were not raised before.
Angular 6

@ohabash
Copy link

ohabash commented Jul 5, 2018

I found out that there are extra tests during the prod build. I just started compiling more often. but here is more details about what worked for me. https://stackoverflow.com/questions/50337954/angular-5-ng-build-shows-no-errors-ng-build-prod-has-many-errors

@giordanocardillo
Copy link

Seriously! this is huge. Has anyone found answers?

All through dev there were no errors now at launch i have 20 errors that make no sense. The errors should have been seen during dev. Please help

+1 here, angular 7 and angular 2.

@tolashipov
Copy link

+1 as well (angular 5).
This is a major bug. My whole project is now garbage.
Everything works smoothly on developer mode, and then production fails to load a page with a message:
"l is not a constructor" - the worst thing about it is I have no clue where the source of the error is, because it's all uglified, in one row and with too many "l" variables.

@ngbot ngbot bot added this to the needsTriage milestone Jan 24, 2019
@filipesilva
Copy link
Contributor

We've had a couple of problems with production bundles and optimization in the past, but it's hard to know what's going on from the reports here. The problems that you are experiencing might very well be fixed in the latest CLI versions. You can get more details about the exact line where the problem comes up by adding in sourcemaps to your projection builds too.

If you're still having problems on production builds only, can you open a new issue and 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.

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests