Typescript error Property 'message' does not exist on type when using`errors.myField.message` after upgrading to 7.7.1
See original GitHub issueDescribe the bug
After upgrading from 7.7.0 to 7.7.1 I am getting a typescript error
Property 'message' does not exist on type
when trying to display the error message of a nested object. This did not give an error in 7.7.0.
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/jolly-bell-szqwf?file=/src/App.tsx
- Notice the typescript error message at line 30
property message does not exist
Codesandbox link (Required) https://codesandbox.io/s/jolly-bell-szqwf?file=/src/App.tsx
Expected behavior There is no typescript error. The error message seems to properly display so I would expect that that the types would reflect that the message property exists.
Desktop (please complete the following information):
- OS: Mac
- Browser Chrome
- Version Version 90.0.4430.212 (Official Build) (x86_64)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Why Typescript throw error message: Property does not exist ...
Basically, Typescript doesn't keep track of a relationship between the types of the variables action and type ; when type 's type is...
Read more >Deciphering TypeScript's React errors | by Fiona Hopkins |
When TypeScript complains, its error messages are verbose, ... The fix: When you see “ Property XXX does not exist on type ,”...
Read more >How to fix 'Property does not exist on type Window in ...
The code worked fine, but the classic 'Property does not exist on type Window in TypeScript' error flagged up on the build command...
Read more >Typescript Type System: How Does it Really Work? Type ...
Let's have a look at the error message we get: Error:(54, 6) TS2339:Property 'name' does not exist on type '{}'. So what is ......
Read more >Typescript Errors How do I ignore the error property does not ...
I get many `The property 'x' does not exist on value of type 'y'` errors, which I want to ignore when using JS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @bluebill1049, strange that the error didn’t show up in 7.7.0.
Thank you so much for the quick response, that looks like it works.
Any update regarding this?
NestesValue
doesn’t even accept nativeFile
… 😄 I’m stuck at trying to upload a logo file in TS but I can’t figure out how to properly declare the type of such field