Hello everyone,
I’m trying to deploy angular app but I’m having this issue.
The build folder is in dist/defi but the error tellme to change it to /dist/defi/browser.
& when I perform this change, I’m having an error which says that the folder /dist/defi/browser does not exists…
Can someone help me please?
Plugin “@netlify/angular-runtime” failed
11:04:50 PM: ────────────────────────────────────────────────────────────────
11:04:50 PM:
11:04:50 PM: Error message
11:04:50 PM: Error: Publish directory is configured incorrectly. Please set it to “dist/defi/browser”.
11:04:50 PM:
11:04:50 PM: Plugin details
11:04:50 PM: Package: @netlify/angular-runtime
11:04:50 PM: Version: 2.0.2
11:04:50 PM: Repository: git+https://github.com/netlify/angular-runtime.git
11:04:50 PM: npm link: @netlify/angular-runtime - npm
11:04:50 PM: Report issues: Issues · netlify/angular-runtime · GitHub
11:04:50 PM:
11:04:50 PM: Error location
11:04:50 PM: In “onPreBuild” event in “@netlify/angular-runtime” from Netlify app
11:04:50 PM:
11:04:50 PM: Resolved config
11:04:50 PM: build:
11:04:50 PM: command: ng build
11:04:50 PM: commandOrigin: config
11:04:50 PM: publish: /opt/build/repo/dist/defi
11:04:50 PM: publishOrigin: config
11:04:50 PM: plugins:
11:04:50 PM: - inputs: {}
11:04:50 PM: origin: ui
11:04:50 PM: package: “@netlify/angular-runtime”
11:04:50 PM: redirects:
11:04:50 PM: - from: /*
status: 200
to: /index.html
redirectsOrigin: config
11:04:50 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:04:50 PM: Failing build: Failed to build site
11:04:50 PM: Finished processing build request in 39.376s
Do you have publish directory configured in your netlify.toml file? If so, that will override whatever is configured in the UI so you’ll need to make the change in that file.
Thanks for your answer @audrey
I do not have any netlify.toml file in my project.
It’s very weird. I need your support to investigate on this issue please it’s been almost 1 week and I’m stuck…
So if you really wish Angular to export your site to /dist/defi/browser, simply change your publish path to /dist/defi/browser/browser. If not, remove the /browser from your Angular config.
Ok now I removed netlify.toml & removed /browser from angular.json. But i’m having another error:
It was so easy to deploy an angular app on netlify by the past, I dunno what happenned
3:00:19 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
3:00:18 PM: Deploy site
3:00:18 PM: ────────────────────────────────────────────────────────────────
3:00:18 PM:
3:00:18 PM: Section completed: deploying
3:00:18 PM:
3:00:18 PM: Configuration error
3:00:18 PM: ────────────────────────────────────────────────────────────────
3:00:18 PM:
3:00:18 PM: Error message
3:00:18 PM: Deploy did not succeed: Deploy directory "dist/defi/browser" does not exist
3:00:18 PM:
3:00:18 PM: Resolved config
3:00:18 PM: build:
3:00:18 PM: command: ng build
3:00:18 PM: commandOrigin: ui
3:00:18 PM: publish: /opt/build/repo/dist/defi/browser
3:00:18 PM: publishOrigin: ui
3:00:18 PM: plugins:
3:00:18 PM: - inputs: {}
3:00:18 PM: origin: ui
3:00:18 PM: package: "@netlify/angular-runtime"
3:00:19 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:00:19 PM: Failing build: Failed to build site
Thanks, I just tried your repo and something is wrong on our end. I’m not sure why the plugin is adding the browser to the path. But for you, the solution would be to go to build settings: Build & deploy | Site configuration | celadon-strudel-94430d | Netlify, choose edit, and from the Runtime, click on Remove: