types/sequelize

TS2503: Cannot find namespace 'ValidatorJS'

Closed this issue ยท 7 comments

run tsc
TS2503: Cannot find namespace 'ValidatorJS'

@Diluka I'm getting this issue as well - how did you end up resolving this?

louy commented

I recommend switching to @types/sequelize and @types/validator

I recommend switching to @types/sequelize and @types/validator

@types/sequelize used @types/validator already:
https://github.com/types/sequelize/blob/master/package.json#L8

@louy looks like issue here:
image

after adding //@ts-ignore build went good

Any solution?

Worked for me:

yarn add -D '@types/sequelize@4.28.1'
yarn add -D '@types/validator@10.11.3'

Anything newer and things start blowing up.

Note that I don't have a direct dependency on sequelize or validator in my tree. This is all failing because of a third party dependency. Yuck.

My solution:

"dependencies": {
    "sequelize": "^4.41.0",
    "sequelize-typescript": "0.6.11",
},
"devDependencies": {
      "@types/validator": "10.11.3",
      "@types/sequelize": "^4.28.8",
}

For me main issue was in incompatible types.
Answer #143 (comment) is totally right