@types/xxxx package and had problems.Definitions by: in index.d.ts) so they can respond.I'm currently using version 10.11.3 of this package and everything is working fine, but if I upgrade to the latest version (12.0.1), I start getting this error:
error TS2614: Module '".../node_modules/@types/validator"' has no exported member 'isMACAddress'. Did you mean to use 'import isMACAddress from ".../node_modules/@types/validator"' instead?
Is the type for that function no longer being exported?
Having a similar issue with isEmail, i had to import it like this
import * as val from "validator";
...
val.default.isEmail(); // this works
We had a similar issue with isIP, isFQDN and isNumeric , so it probably applies to all exports.
This happened probably after upgrading typescript to 3.7.5 or NodeJS to v12, but not sure.
import isFQDN from 'validator/lib/isFQDN' etc. solved the problem.
I just had the same issue with isEmail.
I am using validator@^13.0.0 and @types/validator@^13.0.0.
@Rogier076 solution worked for me.
import isEmail from 'validator/lib/isEmail';
Most helpful comment
We had a similar issue with
isIP,isFQDNandisNumeric, so it probably applies to all exports.This happened probably after upgrading typescript to 3.7.5 or NodeJS to v12, but not sure.
import isFQDN from 'validator/lib/isFQDN'etc. solved the problem.