Skip to content

Is MutationObserverDirective causing an issue with SSR? #1040

Answered by Teebo
Teebo asked this question in Q&A
Discussion options

You must be logged in to vote

@waterplea Ahh almost...

I followed the instructions:

  1. Import in the server.ts : import '@ng-web-apis/universal/mocks';
  2. Import in app.server.module.ts: UniversalModule

It builds successfully when using dev:ssr script but when I access the app in the browser I get an error:

NullInjectorError: R3InjectorError(AppServerModule)[InjectionToken Mobile browser detection -> InjectionToken An abstraction over window.navigator.userAgent object -> InjectionToken User Agent string passed from server side -> InjectionToken User Agent string passed from server side -> InjectionToken User Agent string passed from server side]: 
  NullInjectorError: No provider for InjectionToken User Agent string passe…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@Breate
Comment options

Comment options

You must be logged in to vote
6 replies
@Teebo
Comment options

@waterplea
Comment options

@Teebo
Comment options

@Teebo
Comment options

@Teebo
Comment options

Answer selected by waterplea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants