Skip to content

Deploy Angular 17 SSR / SSG fails #93

@nivekcode

Description

@nivekcode

Describe the bug
Hi there I generated a new Angular 17 application with the following command:

ng new my-app --ssr

I followed the instructions from this blog post: https://www.netlify.com/blog/deploy-your-angular-v17-apps-to-netlify/. Unfortunately I got the following error during deployment.

5:26:57 PM: Netlify Build                                                 
5:26:57 PM: ────────────────────────────────────────────────────────────────
5:26:57 PM: ​
5:26:57 PM: ❯ Version
5:26:57 PM:   @netlify/build 29.29.4
5:26:57 PM: ​
5:26:57 PM: ❯ Flags
5:26:57 PM:   baseRelDir: true
5:26:57 PM:   buildId: 656dfdadb754b6133966f29c
5:26:57 PM:   deployId: 656dfdadb754b6133966f29e
5:26:57 PM: ​
5:26:57 PM: ❯ Current directory
5:26:57 PM:   /opt/build/repo
5:26:57 PM: ​
5:26:57 PM: ❯ Config file
5:26:57 PM:   No config file was defined: using default values.
5:26:57 PM: ​
5:26:57 PM: ❯ Context
5:26:57 PM:   production
5:26:57 PM: ​
5:26:57 PM: ❯ Installing plugins
5:26:57 PM:    - @netlify/angular-runtime@2.0.4
5:26:58 PM: ​
5:26:58 PM: ❯ Loading plugins
5:26:58 PM:    - @netlify/angular-runtime@2.0.4 from Netlify app
5:26:59 PM: ​
5:26:59 PM: @netlify/angular-runtime (onPreBuild event)                   
5:26:59 PM: ────────────────────────────────────────────────────────────────
5:26:59 PM: ​
5:26:59 PM: ​
5:26:59 PM: (@netlify/angular-runtime onPreBuild completed in 10ms)
5:26:59 PM: ​
5:26:59 PM: Build command from Netlify app                                
5:26:59 PM: ────────────────────────────────────────────────────────────────
5:26:59 PM: ​
5:26:59 PM: $ npm run build
5:26:59 PM: > nothing-special@0.0.0 build
5:26:59 PM: > ng build
5:27:00 PM: - Building...
5:27:11 PM: An unexpected error occurred: [object Object]
5:27:11 PM: ​
5:27:11 PM: "build.command" failed                                        
5:27:11 PM: ────────────────────────────────────────────────────────────────
5:27:11 PM: ​
5:27:11 PM:   Error message
5:27:11 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
5:27:11 PM: ​
5:27:11 PM:   Error location
5:27:11 PM:   In Build command from Netlify app:
5:27:11 PM:   npm run build
5:27:11 PM: ​
5:27:11 PM:   Resolved config
5:27:11 PM:   build:
5:27:11 PM:     command: npm run build
5:27:11 PM:     commandOrigin: ui
5:27:11 PM:     publish: /opt/build/repo/dist/nothing-special/browser
5:27:11 PM:     publishOrigin: ui
5:27:11 PM:   plugins:
5:27:11 PM:     - inputs: {}
5:27:11 PM:       origin: ui
5:27:11 PM:       package: "@netlify/angular-runtime"
5:27:11 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:27:11 PM: Failing build: Failed to build site
5:27:12 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
5:27:12 PM: Finished processing build request in 39.131s

To Reproduce
Steps to reproduce the behavior:

  1. Generate a new Angular application
  2. Push to repo
  3. Setup Netlify deployment with defaults
  4. See error in Deployment log on build step

Expected behavior
We deploy a Angular application with SSR and SSG (hypbrid)

Versions

  • Angular 17

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