Open wtrocki opened 4 years ago
@dgarciap have you found a solution? I'm having the same issue.
same issue here, any workaround?
Strange. I cannot replicate that on sample app in the repo that uses the same version.
@wtrocki I'm using
"typescript": "^4.0.3",
"graphql": "^15.4.0",
"keycloak-admin": "^1.13.0",
"keycloak-connect": "^11.0.2",
"keycloak-connect-graphql": "^0.6.3",
The problem seems to occur when I use
import { KeycloakContext, KeycloakTypeDefs, KeycloakSchemaDirectives } from "keycloak-connect-graphql"
Instead of
const { KeycloakContext, KeycloakTypeDefs, KeycloakSchemaDirectives } = require('keycloak-connect-graphql')
I get cannot find name Request on GrantedRequest when using import
export interface GrantedRequest extends Request {
kauth: {
grant?: Grant;
};
}
Our library exports our own typings. So typinings we can use should be coming from the library itself. https://github.com/aerogear/keycloak-connect-graphql/blob/master/src/KeycloakTypings.ts
Oh.. but you should have express types. I guess reexporting this doesn't sound like bad plan. Maybe we can create PR with the fix.
Woops deleted my last comment.
When adding import { Request } from 'express'; into KeycloakContext.d.ts everything works fine.
Do you have any tips what I can try/do to come around this problem?
To answer my question I'm currently using "@types/express": "^4.17.6"
I'm away from computer till next week so cannot check it. Sample app works. If you can add this to types and still make sample app work I can merge and resolve problem
Did add
import { Request } from 'express'
into
https://github.com/aerogear/keycloak-connect-graphql/blob/master/src/KeycloakContext.ts
worked on sample app.
When you say types do you mean https://github.com/aerogear/keycloak-connect-graphql/blob/master/src/KeycloakTypings.ts ?
Superb. Sounds like PR will solve problem.. Will release it after
thx for quick merge!
Hello, I'm having an error related to this type on the next line:
const kauth = new KeycloakContext({ req });
Error:
Type 'Request<ParamsDictionary, any, any, ParsedQs>' is missing the following properties from type 'GrantedRequest': kauth, cache, credentials, destination, and 16 more
Is it solved?
I'm using:
"keycloak-connect": "^11.0.0", "keycloak-connect-graphql": "^0.6.1",