Skip to content
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

When budgets are not met and statsJson: true is set, the budget error is swallowed #20349

Closed
1 of 15 tasks
mattlewis92 opened this issue Mar 22, 2021 · 2 comments
Closed
1 of 15 tasks

Comments

@mattlewis92
Copy link
Contributor

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 11.2.4

Description

When bundle budgets are not met + statsJson: true is set, ng build fails with a cryptic error message instead of showing the budget error.

🔬 Minimal Reproduction

  • Add budgets that don't pass
  • Set statsJson: true
  • Run ng build --prod

🔥 Exception or Error

✔ Browser application bundle generation complete.
ENOENT: no such file or directory, open '/path/to/repo/dist/apps/app-name/stats.json'

🌍 Your Environment


Angular CLI: 11.2.5
Node: 14.13.1
OS: darwin x64

Angular: 11.2.6
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: 

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.6
@angular-devkit/build-angular   0.1102.5
@angular-devkit/core            11.0.6
@angular-devkit/schematics      11.2.4
@angular/cdk                    9.0.1
@angular/cli                    11.2.5
@angular/google-maps            11.0.3
@schematics/angular             11.2.4
@schematics/update              0.1102.5
ng-packagr                      11.2.3
rxjs                            6.6.3
typescript                      4.1.3

Anything else relevant?
It was this commit that caused the regression, I manually reverted to the old behaviour in my node_modules and verified that it fixed the problem.

clydin added a commit to clydin/angular-cli that referenced this issue Mar 22, 2021
…t before writing stats JSON

If an error occurs during a build, it is possible that the output path directory may not be present and then cause the stats JSON file write to fail.

Fixes: angular#20349
@clydin clydin closed this as completed in ac4c109 Mar 22, 2021
clydin added a commit that referenced this issue Mar 22, 2021
…t before writing stats JSON

If an error occurs during a build, it is possible that the output path directory may not be present and then cause the stats JSON file write to fail.

Fixes: #20349
(cherry picked from commit ac4c109)
@mattlewis92
Copy link
Contributor Author

Verified that this is now fixed in 11.2.6, thanks for the quick turnaround @clydin! 🥳

@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 Apr 24, 2021
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

1 participant