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

question: cannot find namespace 'ValidatorJS'. #510

Closed
nareshdavra302 opened this issue Jan 23, 2020 · 8 comments
Closed

question: cannot find namespace 'ValidatorJS'. #510

nareshdavra302 opened this issue Jan 23, 2020 · 8 comments
Labels
type: question Questions about the usage of the library.

Comments

@nareshdavra302
Copy link

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;

@yusufkhan07
Copy link

I am getting the same issue

@yusufkhan07
Copy link

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

@k-efimov
Copy link

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").

@nareshdavra302
Copy link
Author

setting "skipLibCheck": true in compilerOptions worked for me

@opgbaudouin
Copy link

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.

@vlapo
Copy link
Contributor

vlapo commented May 4, 2020

Please try class-validator@0.12. It should be fixed

@vlapo
Copy link
Contributor

vlapo commented May 5, 2020

Closing in favour of #468

@vlapo vlapo closed this as completed May 5, 2020
@lock
Copy link

lock bot commented May 20, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
@NoNameProvided NoNameProvided changed the title Cannot find namespace 'ValidatorJS'. question: cannot find namespace 'ValidatorJS'. Aug 8, 2020
@NoNameProvided NoNameProvided added the type: question Questions about the usage of the library. label Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: question Questions about the usage of the library.
Development

No branches or pull requests

6 participants