JsonValue Error
Closed this issue · 2 comments
GouravShDev commented
I am trying to run this project in my local machine. Even after following all the instructions in the Readme.md, I am unable to run this app using "denon start" command. I'm getting following error:
error: TS2322 [ERROR]: Type 'string | undefined' is not assignable to type 'JsonValue'.
Type 'undefined' is not assignable to type 'JsonValue'.
id,
~~
at file:///D:/Projects/deno_rest/helpers/jwt.helper.ts:30:7
The expected type comes from this index signature.
[key: string]: JsonValue;
~~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/x/djwt@v2.6/mod.ts:25:3
This error is caused by the following code in jwt.helper.ts
const payload: Payload = {
iss: "deno_rest",
iat: now,
id,
exp,
};
GouravShDev commented
Creating id non-null solves the issue. Should I make pr for the fix?
vicky-gonsalves commented
Creating id non-null solves the issue. Should I make pr for the fix?
Yes thank you for pointing out. non-null id makes more sense. Please go ahead and open a PR.