-
Notifications
You must be signed in to change notification settings - Fork 12k
touched/untouched not working with ng build --prod #8997
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
In fact it seems that more things are not working here. I've commented another issue in Material 2 repo, but I think it's related. Below is the copy of what I posted in Material Repo: angular/components#9120 (comment).
without --prodwith --prodIf it helps, the repo for the test app above: https://github.com/julianobrasil/material2-test
|
I have slimier problem. cli version: 1.6.2 |
@cuiliang, I'll try that. But the funny part is that if I compile the project locally (in my Windows 10 machine), it seems to work just fine. When I deploy to heroku (compile remotely), the problem comes up. |
@cuiliang, it worked [edited]: but the chunks size increased a lot 😸 - cannot use it in production |
new UglifyJSPlugin({
sourceMap: buildOptions.sourcemaps,
uglifyOptions: {
ecma: wco.supportES2015 ? 6 : 5,
warnings: buildOptions.verbose,
ie8: false,
// mangle: {
// safari10: true,
// },
mangle: false,
compress: uglifyCompressOptions,
output: {
ascii_only: true,
comments: false,
webkit: true,
},
}
}), Confirmed it can be solved by disable the |
@julianobrasil Thank you for putting up a repro, it helps a lot. I'm trying to see what the issue with it but I don't think I can reproduce... This is what I did:
Then I opened The input box content seems to be reflected outside of it. @julianobrasil mentioned it doesn't happen locally for him (#8997 (comment)) so maybe that's why it doesn't happen locally for me either. Other users mentioned disabling Uglify mangle helped. Maybe it is related to the Uglify version. We use
For users that are experiencing this problem, what version of |
@filipesilva |
@filipesilva, I did a lot of things after my comment above saying it worked fine over here... now the problem is happening locally too. I don't know whether the uglify was 3.2.1 at that time, but now: |
Bisected to |
Just to confirm @trotyl's info, in other projects that are still working right: And at heroku (problematic): |
I'm investigating what changed in the uglify output between those two versions. Meanwhile for those affected you can force install
At the end it should output the following:
You can see the right version ( |
I've been looking into this and saving output in https://github.com/filipesilva/material2-test/tree/uglifyjs-debug. I haven't found what changed exactly yet. You can see the different in output for the main bundle in https://github.com/filipesilva/material2-test/commit/8daa08f05720fa260a0e4aaee1b6a358e5c95895?w=1 (click I can say that a fair bit has changed though. I can also see that the main bundle is 5k bigger with |
@kzc do you perhaps have an idea of what might have changed, or what I can do to narrow down my search of what's broken? |
@filipesilva our project is also affected. When we deploy, a flag --prod is used. I've followed this direction and it helped: #8997 (comment) |
@filipesilva Please take a look at the https://github.com/mishoo/UglifyJS2/commits/harmony All I can suggest is to update to the most recent version and if it still fails then file an uglify issue with a reproducible JS input. |
@mlurker I suggest you use my workaround in #8997 (comment) instead of replacing the build command, as doing the latter will leave you with much bigger bundles. @kzc I'm going through the most recent commits (mishoo/UglifyJS#2656, mishoo/UglifyJS#2658 and mishoo/UglifyJS#2659) and applying them manually but it doesn't seem to make a difference. Also tried mishoo/UglifyJS#2661. Trying to get in touch with the core team to figure out which bits of core code could originate the current behaviour to narrow it down and get you a good issue repro. |
For what its worth very similar problems with other non material components as well (ngx-bootstrap if it matters). They are non functional, silently not reacting to user clicks. Curiously, the same components used elsewhere on the same page (in other lazy loaded components) continue to work. Running with
|
#8992 has the same root cause as this issue. |
How resolve problem
But not working |
@Alekcei, take a look at #8997 (comment) |
The solution from @filipesilva worked for me. |
@MaxGorshkov Angular CLI does not have a direct dependency in Pinning (using a specific version of a dependency) does not work because you cannot pin subdependencies. In the NPM ecosystem the way you ensure reproducible installs is not via pinning dependencies but rather by using lockfiles, either |
That moment when serious bouts of insomnia are actually beneficial :) This has been pinned in Prior to the next CLI release, anyone having issues should be able to pin the |
Thanks @d3viant0ne, will try to get a release of Angular CLI up. @danbucholtz you might want to pin as well on Ionic's side. |
- Pins uglify-es dependency version on the Webpack side for #8997
Keeping issue opened until the workaround is released. |
The bug causing these problems is reported with repros at mishoo/UglifyJS#2663. |
- Pins uglify-es dependency version on the Webpack side for #8997
Meanwhile mishoo/UglifyJS#2663 has also been fixed and should be part of the next release of |
nice work . i can update now. |
- Pins uglify-es dependency version on the Webpack side for angular#8997
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. |
Versions
Repro steps
ng new testProject
cd testProject
npm install
add code in /src/app/app.component.html:
add code in /src/app/app.component.ts:
add code in /src/app/app.module.ts:
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
...
npm run build
Observed behavior
Desired behavior
as after run ng serve:

The text was updated successfully, but these errors were encountered: