Skip to content

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

Closed
@manzonif

Description

@manzonif

🐞 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

Activity

alan-agius4

alan-agius4 commented on May 25, 2021

@alan-agius4
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.

modified the milestone: Backlog on May 25, 2021
added 2 commits that reference this issue on May 26, 2021
861a695
b0dd4e1
angular-automatic-lock-bot

angular-automatic-lock-bot commented on Jun 26, 2021

@angular-automatic-lock-bot

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.

locked and limited conversation to collaborators on Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @manzonif@alan-agius4

      Issue actions

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