If you know how to fix the issue, make a pull request instead.
@types/xxxx package and had problems.Definitions by: in index.d.ts) so they can respond.Example:
import validator from 'validator';
5:11:26 PM: ERROR in /opt/build/repo/node_modules/@types/validator/index.d.ts
5:11:26 PM: ERROR in /opt/build/repo/node_modules/@types/validator/index.d.ts(1247,8):
5:11:26 PM: TS2303: Circular definition of import alias 'Validator'.
It is caused by the release of @types/[email protected] (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40192)
mark
node_modules/_@[email protected]@@types/sequelize/index.d.ts:6296:33 - error TS2503: Cannot find namespace 'ValidatorJS'.
Related to https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40192, I don't have time to do a PR right now unfortunately
@topwood are you using an older version of sequelize types? I think that might be your issue, which is different to the other one
I鈥檒l try to take a look later today. Strange how CI didn鈥檛 catch that circular reference
In my package.json
"sequelize": "^4.43.1",
"sequelize-typescript": "^0.6.9"
How to slove this? @louy Thank you !

@topwood Can you try updating both packages to the latest?
npm i -S @types/sequelize@latest @types/validator@latest
It still do not work for me..sad
@topwood yeah actually updating to the latest should give you the same issue as above
TS2303: Circular definition of import alias 'Validator'.
I have a fix in #40491
@louy is there any way to circumvent this until we wait for this to get merged?
You can try using an older version of the types package
You can try using an older version of the types package
Is this possible if validator is a dependency of a dependency? In my case sequelize is using validator.
Ok, downgrading @types/sequelize from 4.28.8 to 4.28.1 solved my issue.
i have same problem with
@types/[email protected] and @sequelize-typescript 1.0.0
how can i solve this problem?
Have the same error. I downgraded @types/sequelize to the previous version 10.11.3 and my tsc is working fine now.
ref: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40192#issuecomment-555203904
@asmsuechan @types/sequelize latest version is 4.28.7, do you mean you downgraded to 4.28.6, or are you talking about a different lib?
Edit: Looks like you actually meant @types/validator to 10.11.3
That alone gets rid of namespace issues, but still errors out at circule dependency
As a temporary workaround, installing both @types/[email protected] and @types/[email protected] worked for my project.
@types/[email protected] should now solve this problem
@types/[email protected]should now solve this problem
From my practice, @types/[email protected] cannot solve this problem.
my package.json is
"sequelize": "^5.21.3",
"@types/validator": "^12.0.1",
I still have this error (Cannot find namespace 'ValidatorJS')
My solution was to remove the @types/validator package
npm remove @types/validator
Don't need to use it explicitly after all
Most helpful comment
@topwood yeah actually updating to the latest should give you the same issue as above
I have a fix in #40491