types / sequelize

The typings for https://github.com/sequelize/sequelize
63 stars 37 forks source link

TS2503: Cannot find namespace 'ValidatorJS' #143

Closed Diluka closed 6 years ago

Diluka commented 7 years ago

run tsc TS2503: Cannot find namespace 'ValidatorJS'

hoodsy commented 4 years ago

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

louy commented 4 years ago

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

BYScribble commented 4 years ago

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

BYScribble commented 4 years ago

@louy looks like issue here: image

after adding //@ts-ignore build went good

wizardnet972 commented 4 years ago

Any solution?

lookfirst commented 4 years ago

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.

BYScribble commented 4 years ago

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 https://github.com/types/sequelize/issues/143#issuecomment-564431823 is totally right