Skip to content

deploy error if outputPath.browser is not set #196

Open
@ago1024

Description

@ago1024

I'm using [email protected] to deploy project converted from older angular versions to angular 18 with the new build system.

The angular builder configuration has

"outputPath": {
  "base": "dist"
}

"browser" is not set as it has the default value of browser. https://v17.angular.io/guide/workspace-config#output-path-configuration

ng deploy will fail with

❌ An error occurred when trying to deploy:
The "path" argument must be of type string. Received undefined

Changing the angular builder configuration to

"outputPath": {
  "base": "dist",
  "browser": "browser"
}

fixes the error.

This is caused by deploy/actions.ts where "obj.browser" is expected to have a value.

    if (typeof buildOptions.outputPath === 'string') {
      dir = path.join(buildOptions.outputPath, 'browser');
    } else {
      const obj = buildOptions.outputPath as any;
      dir = path.join(obj.base, obj.browser)  <--- Error
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions