angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular universal schematic broken on v7.3.5

Open abulazm22 opened this issue 7 years ago β€’ 8 comments

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [X] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

I see it working in 7.2.4

Description

A clear and concise description of the problem...

Running ng add @nguniversal/express-engine --clientProject [existingProjectName] only installs @nguniversal/[email protected] and does not create or change files

πŸ”¬ Minimal Reproduction

Update to cli v7.3.5 run ng new new-project run ng add @nguniversal/express-engine --clientProject new-project

πŸ”₯ Exception or Error





🌍 Your Environment




Angular CLI: 7.3.5
Node: 8.12.0
OS: darwin x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.5
@angular-devkit/build-angular     0.11.4
@angular-devkit/build-optimizer   0.11.4
@angular-devkit/build-webpack     0.11.4
@angular-devkit/core              7.3.5
@angular-devkit/schematics        7.3.5
@angular/cli                      7.3.5
@ngtools/webpack                  7.1.4
@schematics/angular               7.3.5
@schematics/update                0.13.5
rxjs                              6.4.0
typescript                        3.1.6
webpack                           4.23.1

Anything else relevant?

abulazm22 avatar Mar 13 '19 09:03 abulazm22

@Fattouh92, before running ng add are you changing the directory to new-project ie: cd new-project?

I am unable to reproduction the issue from my end.

ng add @nguniversal/express-engine --clientProject new-project
Installing packages for tooling via npm.
npm WARN @nguniversal/[email protected] requires a peer of @angular/platform-server@^7.1.4 but none is installed. You must install peer dependencies yourself.

+ @nguniversal/[email protected]
added 1 package and audited 42610 packages in 12.628s
found 0 vulnerabilities

Installed packages for tooling via npm.
CREATE src/main.server.ts (220 bytes)
CREATE src/app/app.server.module.ts (427 bytes)
CREATE src/tsconfig.server.json (219 bytes)
CREATE webpack.server.config.js (1360 bytes)
CREATE server.ts (1472 bytes)
UPDATE package.json (1874 bytes)
UPDATE angular.json (4411 bytes)
UPDATE src/main.ts (432 bytes)

alan-agius4 avatar Mar 13 '19 09:03 alan-agius4

Yes I am changing to the directory, my bad I left it out

abulazm22 avatar Mar 13 '19 11:03 abulazm22

Can you share the complete output of the console?

alan-agius4 avatar Mar 13 '19 11:03 alan-agius4

$ ng add @nguniversal/express-engine --clientProject web-client
Installing packages for tooling via npm.
npm WARN @smec/[email protected] requires a peer of ngx-toastr@^8.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jasmine-core@>=3.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @nguniversal/[email protected] requires a peer of @angular/platform-server@^7.1.4 but none is installed. You must install peer dependencies yourself.

+ @nguniversal/[email protected]
added 1 package and audited 42491 packages in 8.521s
found 3 vulnerabilities (1 low, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Installed packages for tooling via npm.

abulazm22 avatar Mar 13 '19 17:03 abulazm22

Hi, I looked into this and I am still unable to replicate this issue on a newly generated project. Unfortunately, if no one is able to replicate this and provide some further info we'll be unable to address this.

alan-agius4 avatar Mar 14 '19 13:03 alan-agius4

I was able to use the ng g universal schematic with the latest package versions, but now I don't know how to complete the server configuration in the angular.json to get the whole site built, currently, I'm just getting the main.js in the output (I'm evidently quite new to SSR, and I was expecting to get a static copy of my Angular App, sorry)

matheo avatar Mar 16 '19 19:03 matheo

Hi @matheo, I suggest to redirect support requests to StackOverflow using tag angular-cli or gitter.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

alan-agius4 avatar Mar 19 '19 08:03 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.