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
TS Type Definitions appear to have issues. When upgrading to the latest version, I start getting the following error:
TypeError: isbot_1.default is not a function
After upgrading to 2.4.0, the old way of importing the library in TS started throwing errors in the TS compiler:
import * as isBot from 'isbot';
Now generates the following error:
Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("node_modules/isbot/index")' has no compatible call signatures.ts(2349)
To remove the TS compiler error, I had to change the import to:
import isBot from 'isbot';
But this now throws a runtime error (compilation works OK), as follows:
TypeError: isbot_1.default is not a function
I can see that the main change from the previous version I was using (v2.1.2) is the addition of the type defs (.d.ts) file in the package.
I have done some research, and this kind of error usually is linked to invalid TS definition files. Some similar issues found on the web, with packages having similar problems:
TS Type Definitions appear to have issues. When upgrading to the latest version, I start getting the following error:
TypeError: isbot_1.default is not a function
After upgrading to 2.4.0, the old way of importing the library in TS started throwing errors in the TS compiler:
import * as isBot from 'isbot';
Now generates the following error:
Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("node_modules/isbot/index")' has no compatible call signatures.ts(2349)
To remove the TS compiler error, I had to change the import to:
import isBot from 'isbot';
But this now throws a runtime error (compilation works OK), as follows:
TypeError: isbot_1.default is not a function
I can see that the main change from the previous version I was using (v2.1.2) is the addition of the type defs (.d.ts) file in the package.
I have done some research, and this kind of error usually is linked to invalid TS definition files. Some similar issues found on the web, with packages having similar problems:
microsoft/TypeScript#7554
iamkun/dayjs#475
My current tsconfig.json file is:
And environment:
The text was updated successfully, but these errors were encountered: