StaticInjectorError with Angular universal server side rendering
See original GitHub issueHi,
I’m upgrading an Angular Universal project to the latest Angular version and I get errors with the ng-block-ui version 2.0.0-beta2. It worked fine with Angular 4 and ng-block-ui 1.0.6. Steps to reproduce:
git clone https://github.com/angular/universal-starter.git
.npm i
.npm i --save ng-block-ui@next
.- Add ng-block-ui as described in the docs.
npm run build:ssr && npm run serve:ssr
.- Open http://localhost:4000.
Result: I get the following error:
Error: StaticInjectorError(AppServerModule)[BlockUIContentComponent -> BlockUIInstanceService]: StaticInjectorError(Platform: core)[BlockUIContentComponent -> BlockUIInstanceService]: NullInjectorError: No provider for BlockUIInstanceService!
I created a demo repository in https://github.com/SoftwareAndOutsourcing/universal-starter-ng-block-ui-demo following the above steps.
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
node.js - Angular Universal SSR CRUD App: NullInjectorError ...
I'm working on a CRUD app walk through for an Angular Universal with server-side rendering, using MongoDB. I've done some simple, ...
Read more >angular-oauth2-oidc with server side rendering and ... - GitHub
I have created a reusable module wrapper for authentication using your OAuth flow that runs with Angular 8 and server side rendering using ......
Read more >angular/universal - Gitter
ERROR Error: StaticInjectorError[t -> InjectionToken REQUEST]: ... I am using Angular Universal to combine multiple components server side at build time.
Read more >Server-side rendering (SSR) with Angular Universal
This guide describes Angular Universal, a technology that renders Angular applications on the server. A normal Angular application executes in the browser, ...
Read more >How to Create Search Engine-friendly ... - Twilio
Create an Angular application with one component, the home page; Add server-side rendering for SEO purposes with Angular Universal ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried 2.0.0-beta.3 and everything seems working fine. Thanks again for your help.
Yeah, it might make sense to add in Angular CLI in the future. When I first created the library the CLI was lacking from a library author standpoint, this looks promising though!
I published a new version
ng-block-ui@2.0.0-beta.3
that is working for me in the Angular Universal test repo you shared. Give it a shot and let me know if you have any issues.