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

default AuthContext value fails TypeScript compilation #5406

Closed
bayareacoder opened this issue Oct 16, 2020 · 2 comments · Fixed by #5408
Closed

default AuthContext value fails TypeScript compilation #5406

bayareacoder opened this issue Oct 16, 2020 · 2 comments · Fixed by #5408
Assignees
Labels

Comments

@bayareacoder
Copy link

bayareacoder commented Oct 16, 2020

I believe issue #5372 is not yet fixed since only id was set to a string.
There is still a problem with the fullName property of defaultIdentity which is set to null in AuthContext.txt, giving error:
type 'null' is not assignable to type 'string | undefined'.

const defaultIdentity: UserIdentity = {
id: '',
fullName: null
 };

However UserIdentity type has:

fullName?: string;

so it can either be a string or undefined, but not null.

If you can't repro this it's probably because you have 'strict' set to false in tsconfig, which disables strict null checks (so null is valid for a string type)

Using TS 3.9.4

@fzaninotto
Copy link
Member

Building ra-core with "strick": true fails with 175 errors. I think there must be another reason why you're having this error and we don't.

@bayareacoder
Copy link
Author

Building ra-core with "strick": true fails with 175 errors. I think there must be another reason why you're having this error and we don't.

This was the first error that popped up. Did a search based on error string and saw the earlier issue that I referenced. Doesn’t mean there are no other errors. Yes it builds fine with “strict:false”.

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

Successfully merging a pull request may close this issue.

2 participants