Running into deploy error with angular app

PLEASE help us help you by writing a good post!

  • We need to know your netlify site name. Netlify App

  • Build problems? below is my build log

I can not seem to get past the above build error. The main error message is: Error: Publish directory is configured incorrectly. Please set it to “dist/giboney-electric/browser”, however my dist folder is structured as dist/giboney-electric in my repo. There is no ‘browser’ folder. Can someone assist me with this?

5:02:24 PM: Netlify Build 5:02:24 PM: ──────────────────────────────────────────────────────────────── 5:02:24 PM: ​ 5:02:24 PM: ❯ Version 5:02:24 PM: @netlify/build 29.31.0 5:02:24 PM: ​ 5:02:24 PM: ❯ Flags 5:02:24 PM: baseRelDir: true 5:02:24 PM: buildId: 6574fff6672322000800edc3 5:02:24 PM: deployId: 6574fff6672322000800edc5 5:02:24 PM: ​ 5:02:24 PM: ❯ Current directory 5:02:24 PM: /opt/build/repo 5:02:24 PM: ​ 5:02:24 PM: ❯ Config file 5:02:24 PM: No config file was defined: using default values. 5:02:24 PM: ​ 5:02:24 PM: ❯ Context 5:02:24 PM: production 5:02:24 PM: ​ 5:02:24 PM: ❯ Installing plugins 5:02:24 PM: - @netlify/angular-runtime@2.0.4 5:02:25 PM: ​ 5:02:25 PM: ❯ Loading plugins 5:02:25 PM: - @netlify/angular-runtime@2.0.4 from Netlify app 5:02:26 PM: ​ 5:02:26 PM: @netlify/angular-runtime (onPreBuild event) 5:02:26 PM: ──────────────────────────────────────────────────────────────── 5:02:26 PM: ​ 5:02:26 PM: ​ 5:02:26 PM: Plugin "@netlify/angular-runtime" failed 5:02:26 PM: ──────────────────────────────────────────────────────────────── 5:02:26 PM: ​ 5:02:26 PM: Error message 5:02:26 PM: Error: Publish directory is configured incorrectly. Please set it to "dist/giboney-electric/browser". 5:02:26 PM: ​ 5:02:26 PM: Plugin details 5:02:26 PM: Package: @netlify/angular-runtime 5:02:26 PM: Version: 2.0.4 5:02:26 PM: Repository: git+https://github.com/netlify/angular-runtime.git 5:02:26 PM: npm link: https://www.npmjs.com/package/@netlify/angular-runtime 5:02:26 PM: Report issues: https://github.com/netlify/angular-runtime/issues 5:02:26 PM: ​ 5:02:26 PM: Error location 5:02:26 PM: In "onPreBuild" event in "@netlify/angular-runtime" from Netlify app 5:02:26 PM: ​ 5:02:26 PM: Resolved config 5:02:26 PM: build: 5:02:26 PM: command: npm run build 5:02:26 PM: commandOrigin: ui 5:02:26 PM: publish: /opt/build/repo/dist/giboney-electric 5:02:26 PM: publishOrigin: ui 5:02:26 PM: plugins: 5:02:26 PM: - inputs: {} 5:02:26 PM: origin: ui 5:02:26 PM: package: "@netlify/angular-runtime" 5:02:27 PM: Failed during stage "building site": Build script returned non-zero exit code: 2 5:02:27 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 5:02:27 PM: Failing build: Failed to build site 5:02:27 PM: Finished processing build request in 28.022s

Looks related to: Angular deployment issue - Support - Netlify Support Forums

Once I removed the default “Angular” selection that auto populates in the deployment settings my build succeeded without issue. The Angular auto populate must require a sub folder called browser within the dist folder that my repo did not have.

Why does the dist/project-name/browser route automatically become required if the system detects an angular repo?

That’s currently a bug and there are open PRs to fix it.