Closed omarbelkhodja closed 1 month ago
This is a weird error. The dependency in question, DYNAMICHOOKS_FORROOTCHECK
, is only injected once in the whole library: as the first argument of the constructor of the main OutletComponent (ngx-dynamic-hooks
). So obviously, it is being used in a proper injection context contrary to what the error says and normally works fine. What's more, it even uses the @Optional()
decorator, so even if the dependency couldn't be found, it shouldn't throw an error.
To be totally honest, I find the intricacies of SSR hard to debug, but I'm wondering if this might be something else. The question kind of is whether it errors out b/c of DYNAMICHOOKS_FORROOTCHECK
specifically, or b/c its the very first dependency injected anywhere in the library - and he simply has problems injecting anything and there's some other problem afoot.
As for the latter, according to this post where someone also tries to use a library, it appears that this error can sometimes appear due to having somehow bundled multiple @angular/core
s. Is this something you can investigate?
Just as an addendum for other people who might encounter the same error:
Version 3 of the library was just released with native support for SSR. You can still pass in your own custom PlatformService, but it shouldn't be necessary anymore.
I'm trying to make the SSR work with usage of the ngx-dynamic-hooks module, like described in "8.2 Non-browser Platforms implemention". Although, I'm correctly setting
I'm facing the following injection error:
Any idea about what am I doing wrong please ? How can I debug this ? Further debug showed the injection that is failing is DYNAMICHOOKS_FORROOTCHECK