You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I'm facing issues while using it in a TypeScript project. I have tried the following approaches:
As per README
(import UserAgent from 'user-agents';)
I get TypeError: user_agents_1.default is not a constructor error
Based on Not work require().default #10
(import * as UserAgent from 'user-agents';)
I get TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. error
I investigated and I tried to learn more about the issue, you should check this StackOverflow.
Is it possible to fix it in the near-term so as to avoid using esModuleInterop flag?
The text was updated successfully, but these errors were encountered:
However, I'm facing issues while using it in a TypeScript project. I have tried the following approaches:
* As per README
(`import UserAgent from 'user-agents';`)
I get `TypeError: user_agents_1.default is not a constructor` error
* Based on [Not work require().default #10](https://github.com/intoli/user-agents/issues/10)
(`import * as UserAgent from 'user-agents';`)
I get `TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.` error
I investigated and I tried to learn more about the issue, you should check this StackOverflow.
Is it possible to fix it in the near-term so as to avoid using esModuleInterop flag?
Hi,
Great module. Thank you for it.
However, I'm facing issues while using it in a TypeScript project. I have tried the following approaches:
As per README
(
import UserAgent from 'user-agents';
)I get
TypeError: user_agents_1.default is not a constructor
errorBased on Not work require().default #10
(
import * as UserAgent from 'user-agents';
)I get
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
errorI investigated and I tried to learn more about the issue, you should check this StackOverflow.
Is it possible to fix it in the near-term so as to avoid using
esModuleInterop
flag?The text was updated successfully, but these errors were encountered: