nxteword
12/13/2020, 8:24 AMrp
12/13/2020, 8:25 AMnxteword
12/13/2020, 8:25 AMrp
12/13/2020, 8:25 AMnxteword
12/13/2020, 8:46 AMconnectionURI
from process.env.SUPERTOKENS_URI
, it looks like the type for it is string | undefined
, and type for connectionURI
is string, so I'm unable to assign this, is there a workaround for this other than adding // @ts-ignore
above it?rp
12/13/2020, 8:48 AMts
let connectionURI: string | undefined = process.env.SUPERTOKENS_URI;
if (connectionURI === undefined) {
throw new Error("Please provide the SuperTokens connectionURI");
}
supertokens.init({...})
This way, I think TS will stop throwing the error.nxteword
12/13/2020, 8:49 AMrp
12/13/2020, 8:49 AMrp
12/13/2020, 8:49 AMnxteword
12/13/2020, 8:49 AMnxteword
12/13/2020, 8:49 AMconst connectionURI = process.env.SUPERTOKENS_URI || "https://try.supertokens.io";
nxteword
12/13/2020, 8:50 AMrp
12/13/2020, 8:51 AMtry.supertokens.io
is not meant for any production use. It's only meant for trying out supertokens quickly. So I would still prefer to throw an error or something in case process.env.SUPERTOKENS_URI
is undefined
nxteword
12/13/2020, 8:51 AMnxteword
12/13/2020, 8:51 AMrp
12/13/2020, 8:51 AMnxteword
12/13/2020, 8:52 AMnxteword
12/13/2020, 8:52 AMrp
12/13/2020, 8:52 AMlet
insteadnxteword
12/13/2020, 8:52 AMnxteword
12/15/2020, 6:16 PMEmailPassword.init()
and Session.init()
are causing error saying An argument for 'config' was not provided.
, I think you have to make config argument optional in type definition? I'm new to typescript, can you please suggest a solution? Thanks.rp
12/16/2020, 5:15 AMrp
12/16/2020, 5:15 AMrp
12/16/2020, 5:25 AMnxteword
12/16/2020, 8:27 AMrp
12/16/2020, 6:54 PM3.2.1
. It has a few important fixesrp
12/16/2020, 6:54 PMnxteword
12/17/2020, 2:17 AMuser
12/17/2020, 3:03 AMrp
12/17/2020, 3:06 AMrp
12/17/2020, 3:06 AM