Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No provider for InjectionToken RESPONSE/REQUEST #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

glettl
Copy link

@glettl glettl commented Jan 17, 2020

Hi,

I am very happy with this module, however, I think there is an issue in the dependencies of the ServerCookiesService. I am getting an "No provider for InjectionToken RESPONSE" and "No provider for InjectionToken REQUEST" error.

I cloned the repo and changed to dependency injections to:

... import {REQUEST, RESPONSE} from '@nguniversal/express-engine/tokens'; ... export class ServerCookiesService extends CookiesService { ... constructor( cookiesOptions: CookiesOptionsService, @Inject(REQUEST) private request: any, @Inject(RESPONSE) private response: any ) { super(cookiesOptions); }

It seems like the injection using the strings in @Inject('REQUEST') and @Inject('RESPONSE') does not work any longer. I am using Angular 8. Here are the Angular dependencies from the package.json

{ "@angular/animations": "^8.2.14", "@angular/common": "^8.2.14", "@angular/compiler": "^8.2.14", "@angular/core": "^8.2.14", "@angular/forms": "^8.2.14", "@angular/platform-browser": "^8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/router": "^8.2.14", "@angular/upgrade": "^8.2.14", "@nguniversal/common": "^8.2.6", "@nguniversal/express-engine": "^8.2.6", "@nguniversal/module-map-ngfactory-loader": "^8.2.6", "angular-in-memory-web-api": "^0.9.0" }

If you think this change might be useful, I could implement it.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants