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

ESBuild throws errors when copying assets during build [Next8] #26042

Closed
spock123 opened this issue Oct 14, 2023 · 3 comments
Closed

ESBuild throws errors when copying assets during build [Next8] #26042

spock123 opened this issue Oct 14, 2023 · 3 comments

Comments

@spock123
Copy link

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

When making a production build of our code, using browser-esbuild, the process throws an error when it comes to copying assets into the dist folder.

The same build works in the old builder.

The involved files and folders do exist, as it also works in the old (current) builder.
Destination is a directory, as it's the folder for our build.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

[Error: EISDIR: illegal operation on a directory, copyfile '/Users/spock/projects/fresto/apps/totti/src/robots.txt' -> '/Users/spock/projects/fresto/apps/totti/dist/totti'] {
  errno: -21,
  code: 'EISDIR',
  syscall: 'copyfile',
  path: '/Users/spock/projects/fresto/apps/totti/src/robots.txt',
  dest: '/Users/spock/projects/fresto/apps/totti/dist/totti'
}

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.0-next.8
Node: 18.18.1
Package Manager: npm 9.8.1
OS: darwin arm64

Angular: 17.0.0-next.8
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                              Version
--------------------------------------------------------------
@angular-devkit/architect            0.1700.0-next.8
@angular-devkit/build-angular        17.0.0-next.8
@angular-devkit/core                 17.0.0-next.8
@angular-devkit/schematics           17.0.0-next.8
@angular/cdk                         17.0.0-next.6
@angular/fire                        7.5.0
@angular/material                    17.0.0-next.6
@angular/material-date-fns-adapter   17.0.0-next.6
@schematics/angular                  17.0.0-next.8
rxjs                                 7.5.7
typescript                           5.2.2
zone.js                              0.14.0

Anything else?

No response

@spock123
Copy link
Author

Angular.json:


{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "cli": {
        "packageManager": "npm",
        "analytics": "ac59db6d-a680-408f-af50-2623fb62aeae"
    },
    "newProjectRoot": "projects",
    "projects": {
        "totti": {
            "projectType": "application",
            "schematics": {
                "@schematics/angular:component": {
                    "style": "scss",
                    "skipTests": true,
                    "standalone": true,
                    "changeDetection": "OnPush"
                },
                "@schematics/angular:class": {
                    "skipTests": true
                },
                "@schematics/angular:directive": {
                    "skipTests": true,
                    "standalone": true
                },
                "@schematics/angular:guard": {
                    "skipTests": true
                },
                "@schematics/angular:interceptor": {
                    "skipTests": true
                },
                "@schematics/angular:pipe": {
                    "skipTests": true,
                    "standalone": true
                },
                "@schematics/angular:resolver": {
                    "skipTests": true
                },
                "@schematics/angular:service": {
                    "skipTests": true
                }
            },
            "root": "",
            "sourceRoot": "src",
            "prefix": "app",
            "architect": {
                "build": {
                    "builder": "@angular-devkit/build-angular:browser-esbuild",
                    "options": {
                        "allowedCommonJsDependencies": [],
                        "outputPath": "dist/totti/",
                        "index": "src/index.html",
                        "main": "src/main.ts",
                        "polyfills": ["zone.js"],
                        "tsConfig": "tsconfig.app.json",
                        "inlineStyleLanguage": "scss",

                        "styles": ["src/styles/index.scss"],
                        "assets": ["src/assets", "src/robots.txt", "src/manifest.json"],

                        "scripts": [],
                        "serviceWorker": true,
                        "ngswConfigPath": "ngsw-config.json"
                    },
                    "configurations": {
                        "production": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.prod.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "localprod": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.localprod.ts"
                                }
                            ],
                            "outputHashing": "all"
                        },
                        "test": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.test.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "localtest": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.test.ts"
                                }
                            ],
                            "outputHashing": "all"
                        },
                        "development": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.dev.ts"
                                },
                                {
                                    "replace": "src/app/shared/store/build-specifics/index.ts",
                                    "with": "src/app/shared/store/build-specifics/index.prod.ts"
                                }
                            ],
                            "outputHashing": "all",
                            "sourceMap": true,
                            "vendorChunk": false,
                            "buildOptimizer": false,
                            "serviceWorker": true,
                            "namedChunks": false
                        },
                        "local": {
                            "buildOptimizer": false,
                            "optimization": false,
                            "sourceMap": true
                        }
                    },
                    "defaultConfiguration": "production"
                },
                "serve": {
                    "builder": "@angular-devkit/build-angular:dev-server",
                    "configurations": {
                        "production": {
                            "buildTarget": "totti:build:production"
                        },
                        "localprod": {
                            "buildTarget": "totti:build:localprod"
                        },
                        "localtest": {
                            "buildTarget": "totti:build:localtest"
                        },
                        "test": {
                            "buildTarget": "totti:build:test"
                        },
                        "development": {
                            "buildTarget": "totti:build:development"
                        },
                        "local": {
                            "buildTarget": "totti:build:local"
                        }
                    },
                    "defaultConfiguration": "local"
                },
                "extract-i18n": {
                    "builder": "@angular-devkit/build-angular:extract-i18n",
                    "options": {
                        "buildTarget": "totti:build"
                    }
                },
                "test": {
                    "builder": "@angular-devkit/build-angular:karma",
                    "options": {
                        "polyfills": ["zone.js", "zone.js/testing"],
                        "tsConfig": "tsconfig.spec.json",
                        "inlineStyleLanguage": "scss",
                        "assets": ["src/favicon.ico", "src/assets", "src/manifest.json"],
                        "styles": ["src/styles/index.scss"],
                        "scripts": []
                    }
                }
            }
        }
    }
}

@crisbeto crisbeto transferred this issue from angular/angular Oct 15, 2023
@alan-agius4
Copy link
Collaborator

Duplicate of #26021

@alan-agius4 alan-agius4 marked this as a duplicate of #26021 Oct 15, 2023
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2023
@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 Nov 15, 2023
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

2 participants