-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
The error "Object is possibly null or undefined" is ambiguous. #8274
Comments
we can not write the full expression, this could be a function call, a function expression, a whole program .. the error span seems correct to me. @sandersn and @DanielRosenwasser any ideas on making this error message better? |
You could have a more helpful error message when the possibly null value is an identifier or property/element access, For more complex expressions, just default to the other one. An alternative is to check for each of the possible forms and report the specifics.
|
If you change the code so that it's |
Though it is not every time I just look at my IDE. I some time look at the output of my terminal. |
Doh! Sorry I needed to do |
Is this issue still open? Can I go for it? Any pointers what file should I go for this fix? |
I have problem distinguishing if the accessor
options
orheaders
or both is possibly undefined or null below.Can it instead of using the text
Object is possibly...
output the accessor expression'this.option.headers' is possibly ...
?The text was updated successfully, but these errors were encountered: