Class-validator: question: cannot find namespace 'ValidatorJS'.

Created on 23 Jan 2020  路  8Comments  路  Source: typestack/class-validator

getting an error while transpile, tsc --project ./tsconfig.build.json

node_modules/class-validator/validation/Validator.d.ts:383:38 - error TS2503: Cannot find namespace 'ValidatorJS'.

383 isISSN(value: unknown, options?: ValidatorJS.IsISSNOptions): boolean;

question

Most helpful comment

setting "skipLibCheck": true in compilerOptions worked for me

All 8 comments

I am getting the same issue

Setting "esModuleInterop": true in compilerOptions in tsconfig.json file fixed it

Setting "esModuleInterop": true in compilerOptions in tsconfig.json file fixed it

I am getting the same issue and setting "esModuleInterop": true doesn't work for me.
I found that there is @types/validator in node_modules which is installed due to sequelize-typescript as peerDependencies. But it has the newer version("12.0.1").

setting "skipLibCheck": true in compilerOptions worked for me

I fixed the issue by setting @types/validator in devDependencies:


 "devDependencies": {
...
    "@types/validator": "13.0.0",
...
},
"dependencies": {
...
    "class-validator": "0.12.2",
    "class-transformer": "0.2.3",
    "class-transformer-validator": "0.8.0"
...
}

Setting "skibLibCheck": true would 'fix' the compiler error but you might as well NOT be using TS - so fail to understand the 12 upvotes.

Please try [email protected]. It should be fixed

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ibox4real picture ibox4real  路  4Comments

jerradpatch picture jerradpatch  路  5Comments

isergey picture isergey  路  3Comments

AndyBarron picture AndyBarron  路  3Comments

st-clair-clarke picture st-clair-clarke  路  3Comments