Angular Universal Plugin Error

Netlify site name: angular-universal.netlify.app

When building using the netlify-plugin-angular-universal (GitHub - netlify/netlify-plugin-angular-universal: Supports Angular Universal on Netlify! (in beta)) i’m getting the following error:

1:01:56 PM: ​
1:01:56 PM: ────────────────────────────────────────────────────────────────
1:01:56 PM:   Plugin "@netlify/plugin-angular-universal" failed             
1:01:56 PM: ────────────────────────────────────────────────────────────────
1:01:56 PM: ​
1:01:56 PM:   Error message
1:01:56 PM:   Error: No value defined for projectName. Check plugin inputs in netlify.toml.
1:01:56 PM: ​
1:01:56 PM:   Plugin details
1:01:56 PM:   Package:        @netlify/plugin-angular-universal
1:01:56 PM:   Version:        1.0.1
1:01:56 PM:   Repository:     git+https://github.com/netlify/netlify-plugin-angular-universal.git
1:01:56 PM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-angular-universal
1:01:56 PM:   Report issues:  https://github.com/netlify/netlify-plugin-angular-universal/issues
1:01:56 PM: ​
1:01:56 PM:   Error location
1:01:56 PM:   In "onPreBuild" event in "@netlify/plugin-angular-universal" from netlify.toml and package.json
1:01:56 PM:       at updateAngularJson (/node_modules/@netlify/plugin-angular-universal/src/helpers/updateAngularJson.js:8:12)
1:01:56 PM:       at onPreBuild (/node_modules/@netlify/plugin-angular-universal/src/index.js:23:5)
1:01:56 PM: ​
1:01:56 PM:   Resolved config
1:01:56 PM:   build:
1:01:56 PM:     command: ng build --configuration production && ng run angular-universal:serverless:production
1:01:56 PM:     commandOrigin: config
1:01:56 PM:     publish: /opt/build/repo/dist/angular-universal/browser
1:01:56 PM:     publishOrigin: config
1:01:56 PM:   plugins:
1:01:56 PM:     - inputs: {}
1:01:56 PM:       origin: config
1:01:56 PM:       package: '@netlify/plugin-angular-universal'

Which suggests to me that I need to pass projectName to the package,
so I’ve updated my netlify.toml to:

[build]
command = "ng build --configuration production && ng run angular-universal:serverless:production"
publish = "dist/angular-universal/browser"

[[plugins]]
package = "@netlify/plugin-angular-universal"
  [plugins.inputs]
  projectName = "angular-universal"

and now i’m getting this error:

──────────────────────────────────────────────────────────────────────────
  Plugin "@netlify/plugin-angular-universal" invalid input "projectName"  
──────────────────────────────────────────────────────────────────────────
​
  Error message
  Plugin "@netlify/plugin-angular-universal" does not accept any inputs but you specified: "projectName"
  Check your plugin configuration to be sure that:
    - the input name is spelled correctly
    - the input is included in the plugin's available configuration options
    - the plugin's input requirements have not changed
​
  Plugin inputs
  projectName: angular-universal

Should I be supplying this differently?

Hi there,

Following your site name above, I see you are encountering a Page Not Found error. This is the best place to start for β€œPage Not Found” issues:

If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track :slight_smile:

If none of the above resources help, please write back and let us know so that we can continue to look into this further. Thanks!

Hey,
Thanks for looking
The problem is that the site is unable to deploy due to the angular universal plug-in not working properly

If it were, it would have built the desired application and hosted it in a similar way to next Js (but the angular version).

Hi @jimdrury,

I believe you would be having a file named angular.json. In that you might have specified your project name. Instead of supplying it as an input, try using that name in place of {projectName} in the plugin’s documentation.

Yeah, i found the problem by looking through the source code

Angular doesnt put a key of defaultProject in the angular.json these days - which is what the plugin is looking for.

It can be fixed by adding one - or updating the plugin to take it as an input

1 Like

Thank you for coming back and letting us know! We will also share this thread with the maintainers of the plugin so that they are aware of the obstacle you hit!

Hey,
That’d be great

I’ve actually fixed it and put in a pull-request

https://github.com/netlify/netlify-plugin-angular-universal/pull/57/checks

So hopefully that’ll help in future :slight_smile:

2 Likes

Excellent, thank you!