Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property 'userAgentData' does not exist on type 'Navigator'

Since navigator.userAgent's information will be reduced so I want to migrate to User-Agent Client Hints but it shows error like this:

enter image description here

How do I solve this, please help. Many thanks

like image 460
julanove Avatar asked Sep 13 '25 16:09

julanove


1 Answers

TypeScript doesn't ship with type declarations for the experimental Navigator.userAgentData property by default.

You could install e.g. this package which claims to add the types or just look at its implementation to see how to write the declarations yourself.

like image 153
AKX Avatar answered Sep 15 '25 05:09

AKX