angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

Problem with AngularUniversal schematic #13857

Closed magoss closed 5 years ago

magoss commented 5 years ago

๐Ÿž 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 don't know

Description

Usage of ng add @nguniversal/express-engine does not guarantee Angular Universal app to be ready.

๐Ÿ”ฌ Minimal Reproduction

  1. Establish new angular project with CLI: ng new derek6 --style=scss --routing
  2. Generate SSR with related schematic: ng add @nguniversal/express-engine --clientProject derek6
  3. Launch SSR (Node) application by appropriate command: npm run build:ssr && npm run serve:ssr

Application is up and running without any error.

  1. Go to default port, which app is served on: http://localhost:4000.

It results with the following error: You must pass in a NgModule or NgModuleFactory to be bootstrapped

๐Ÿ”ฅ Exception or Error


Error: You must pass in a NgModule or NgModuleFactory to be bootstrapped
    at View.engine (C:\Users\user\Documents\derek6\dist\server.js:39238:23)
    at View.render (C:\Users\user\Documents\derek6\dist\server.js:123884:8)
    at tryRender (C:\Users\user\Documents\derek6\dist\server.js:121592:10)
    at Function.render (C:\Users\user\Documents\derek6\dist\server.js:121544:3)
    at ServerResponse.render (C:\Users\user\Documents\derek6\dist\server.js:130425:7)
    at C:\Users\user\Documents\derek6\dist\server.js:135:9
    at Layer.handle [as handle_request] (C:\Users\user\Documents\derek6\dist\server.js:123312:5)
    at next (C:\Users\user\Documents\derek6\dist\server.js:123060:13)
    at Route.dispatch (C:\Users\user\Documents\derek6\dist\server.js:123035:3)
    at Layer.handle [as handle_request] (C:\Users\user\Documents\derek6\dist\server.js:123312:5)

๐ŸŒ Your Environment




Angular CLI: 7.3.5
Node: 10.15.1
OS: win32 x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.5
@angular-devkit/build-angular     0.13.5
@angular-devkit/build-optimizer   0.13.5
@angular-devkit/build-webpack     0.13.5
@angular-devkit/core              7.3.5
@angular-devkit/schematics        7.3.5
@angular/cli                      7.3.5
@ngtools/webpack                  7.3.5
@schematics/angular               7.3.5
@schematics/update                0.13.5
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

Anything else relevant?

alan-agius4 commented 5 years ago

Hi, thanks for reporting this however it seems that the issue is cause by the @nguniversal/express-engine.

Can you kindly file an issue in their repo https://github.com/angular/universal?

Thanks.

alan-agius4 commented 5 years ago

Duplicate of https://github.com/angular/universal/issues/1139

angular-automatic-lock-bot[bot] commented 5 years ago

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.