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

Angular 12: build prod error when writing angular-cli-i18n temp dir #20935

Closed
14 tasks
manzonif opened this issue May 25, 2021 · 2 comments · Fixed by #20938
Closed
14 tasks

Angular 12: build prod error when writing angular-cli-i18n temp dir #20935

manzonif opened this issue May 25, 2021 · 2 comments · Fixed by #20938

Comments

@manzonif
Copy link

🐞 Bug report

Command (mark with an x)

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

Description

After updating to 12.0.1, production build process ends with the following error:

Error: Unable to write stats file: ENOENT: no such file or directory, mkdir 'D:\angular\project-root\C:\Users\Fausto\AppData\Local\Temp\angular-cli-i18n-0ocG5L'

I have tried to locate the problem, but without success.
Somewhere, the path to the temporary folder gets corrupted.
Until here: (https://github.com/angular/angular-devkit-build-angular-builds/blob/master/src/utils/i18n-options.js)

    // If inlining store the output in a temporary location to facilitate post-processing
    if (i18n.shouldInline) {
        const tempPath = fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), 'angular-cli-i18n-'));
        buildOptions.outputPath = tempPath;
        // Remove temporary directory used for i18n processing
        process.on('exit', () => {
            try {
                rimraf.sync(tempPath);
            }
            catch { }
        });
    }

All is correct.

🌍 Your Environment


Angular CLI: 11.0.3
Node:  v14.16.0
OS: windows 10 x64

Angular: 12.0.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/build-angular   12.0.1
@angular-devkit/build-optimizer": "~0.1200.1",
@angular/cli": "12.0.1",
@angular/compiler-cli": "12.0.1",
typescript                     4.2.4

@alan-agius4
Copy link
Collaborator

As a workaround you can disable statsJson which is also not recommended to be used unless you are debugging. As stats generation can impact the duration of the build.

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

Successfully merging a pull request may close this issue.

2 participants