question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StaticInjectorError with Angular universal server side rendering

See original GitHub issue

Hi,

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:

  1. git clone https://github.com/angular/universal-starter.git.
  2. npm i.
  3. npm i --save ng-block-ui@next.
  4. Add ng-block-ui as described in the docs.
  5. npm run build:ssr && npm run serve:ssr.
  6. 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SoftwareAndOutsourcingcommented, Aug 7, 2018

I tried 2.0.0-beta.3 and everything seems working fine. Thanks again for your help.

0reactions
kuuurt13commented, Aug 7, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found