Skip to content

Type mismatch with standard @angular-devkit/build-angular:dev-server referencing custom @angular-builders/custom-esbuild:application #1901

Open
@qwenger

Description

@qwenger

Describe the Bug

I recently upgraded an Angular v16 project to v19, switching to the application backend in the process. Moving away from Webpack plugins in favor of esbuild plugins, I replaced the default builder @angular-devkit/build-angular:application with @angular-builders/custom-esbuild:application in the build architect target of angular.json.
If I keep the default builder @angular-devkit/build-angular:dev-server for the target serve (with "buildTarget": "myproject:build:development"), I get the error

An unhandled exception occurred: The "paths[1]" argument must be of type string. Received an instance of Object

If instead I also switch it to @angular-builders/custom-esbuild:dev-server (which I have no real reason for, since I don't set up any custom middleware/...), then it works.

Minimal Reproduction

Any project with a build and a serve targets, where build uses custom-esbuild but serve doesn't.

{
  ...
      "architect": {
        "build": {
          "builder": "@angular-builders/custom-esbuild:application",
          ...
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "buildTarget": "myproject:build:production"
            },
            "development": {
              "buildTarget": "myproject:build:development"
            }
          },
          "defaultConfiguration": "development"
        },
        ...
      },
  ...
}

Expected Behavior

I'm not sure whether that's expected behavior. If it's not, I'd expect the server to run without error.

Environment


Libs
- @angular/core version: 19.1.3
- @angular-devkit/build-angular version: 19.1.4
- @angular-builders/custom-esbuild version: 19.0.0

For Tooling issues:
- Node version: 22.13.1
- Platform: Linux with BusyBox under WSL2+Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions