Open devenbj opened 9 months ago
I also think that it does not make much sense to return a promise when the result can be computed in a complete synchronous way (as the data is already provided).
The stated return type could be easily conditioned to the passed parameters to fix that interface problem.
Note: I'd contribute a fix if it wasn't because I already paid for the privative license, my work would report benefits only to the lib owner, and I'm not happy with how our doubts are not being resolved.
Library version v2.0.0-b2
Describe the bug Following the example: https://docs.uaparser.js.org/v2/api/ua-parser-js/idata/with-client-hints.html for server-side. The example returns a promise with the current client data when the .withClient.Hints() function is added. This generates console errors from the sample code.
To Reproduce Create a page with the v2.0.0b2 version of ua-parser-js. Copy and paste the demo code. Browser errors immediately on the .withClientHints() console.log statements.
Expected behavior An object with the parsed results. This works as expected when not using .withClientHints.
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context It is clear the withClientHints piece is functioning, as my browser changes from Chrome to Brave. For my code, I am feeding in an array of 7 different browsers configs (including Mac OS and iOS), and they all come back as Linux / Brave (my dev platform). They only return when I nest the console.log inside a .then response. When I drop the .withClientHints(), the function returns the data as expected (Brave is identified as Chrome).