nestjs / ng-universal

Angular Universal module for Nest framework (node.js) 🌷
https://nestjs.com
MIT License
441 stars 68 forks source link

Cannot read property 'subscribe' of undefined #10

Closed ghost closed 5 years ago

ghost commented 5 years ago

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Whenever I try to load my Angular Universal project, I get the following error:

TypeError: Cannot read property 'subscribe' of undefined
    at new ApplicationRef (/home/qjnr/Documents/quote-machine/packages/core/src/application_ref.ts:387:33)
    at _createClass (/home/qjnr/Documents/quote-machine/packages/core/src/view/ng_module.ts:186:7)
    at _createProviderInstance (/home/qjnr/Documents/quote-machine/packages/core/src/view/ng_module.ts:144:20)
    at initNgModule (/home/qjnr/Documents/quote-machine/packages/core/src/view/ng_module.ts:74:24)
    at new NgModuleRef_ (/home/qjnr/Documents/quote-machine/packages/core/src/view/refs.ts:496:5)
    at createNgModuleRef (/home/qjnr/Documents/quote-machine/packages/core/src/view/refs.ts:478:10)
    at Object.debugCreateNgModuleRef [as createNgModuleRef] (/home/qjnr/Documents/quote-machine/packages/core/src/view/services.ts:163:10)
    at NgModuleFactory_.create (/home/qjnr/Documents/quote-machine/packages/core/src/view/entrypoint.ts:70:21)
    at /home/qjnr/Documents/packages/core/src/application_ref.ts:231:63
    at ZoneDelegate.invoke (/home/qjnr/Documents/quote-machine/node_modules/zone.js/dist/zone-node.js:391:26)

Expected behavior

It should work.

Minimal reproduction of the problem with instructions

Create an Angular Universal project, and compile it. Then create a Nest.js application and load the AngularUniversal module like the documentation says.

What is the motivation / use case for changing the behavior?

I don't know what to fill in here.

Environment


Nest version: 5.3.7 (`@nestjs/core` module and some others)


For Tooling issues:
- Node version: 11.6.0 
- Platform:  Linux (openSUSE Tumbleweed) 

Others:

Related question on StackOverflow

https://stackoverflow.com/q/54425931/8649828

kamilmysliwiec commented 5 years ago

We need a little bit more context (minimal repository which reproduces your issue).

ghost commented 5 years ago

We need a little bit more context (minimal repository which reproduces your issue).

Okay, so I created the repository here: https://github.com/qjnr/quotemachine

kamilmysliwiec commented 5 years ago

This is not a way to run an Universal app. I'd suggest looking here for reference: https://github.com/kamilmysliwiec/universal-nest

alex-osman commented 5 years ago

Also running into this problem when following the universal-nest repo