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

TypeError: UserAgent is not a constructor #64

Closed
thisiseddy-ab opened this issue Sep 19, 2023 · 1 comment
Closed

TypeError: UserAgent is not a constructor #64

thisiseddy-ab opened this issue Sep 19, 2023 · 1 comment

Comments

@thisiseddy-ab
Copy link

later than this version user-agents@1.0.1434 i get this error "TypeError: UserAgent is not a constructor" i dont know what it causes

import UserAgent from 'user-agents';
const userAgent = new UserAgent();
console.log(userAgent.toString())
console.log(userAgent.data)
@Clackgot
Copy link

Solution
You also need to enable "esModuleInterop": true in tsconfig.json

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

No branches or pull requests

3 participants