0

We just recently updated our project to Angular 8.2 and when I do

ng add @nguniversal/express-engine --clientProject universal

I get

Client app universal not found.

and none of files mentioned in the guide are added or updated and the package.json only contains this addition

"@nguniversal/express-engine": "^8.1.1",

and the build:ssr and serve:ssr scripts are missing.

What is going on here?

user223364
  • 469
  • 1
  • 4
  • 14

1 Answers1

0

You need to change your application name with flag named --clientProject in your command.

ng add @nguniversal/express-engine --yourApplicationName universal

You can find your application name in the angular.json file under projects object.

Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215
  • Please explain because I used the `--clientProject` flag as I stated in my question. – user223364 Oct 29 '19 at 08:42
  • Yes, I am saying you need to replace `clientProject` in the command `.. --clientProject...` with your application name. – Pardeep Jain Oct 29 '19 at 08:56
  • 1
    Oh, you mean the name I supply in the `--clientProject` flag needs to match with a name in the `angular.json` file's list of projects! – user223364 Oct 29 '19 at 08:59
  • Once I do that, I how getting:- `ERROR in error TS6053: File '.../src/src/main.server.ts' not found.` – user223364 Oct 29 '19 at 09:02
  • 1
    In the file `tsconfig.server.json` the `files` array has `src/` on the `main.server.ts` entry. Removing this fixes the problem. – user223364 Oct 29 '19 at 09:22