Comments (18)
The PR was merged, and a release was tagged: https://github.com/typestack/class-validator/releases/tag/v0.14.1
I expect there will be an updated package available soon.
from definitelytyped.
Thanks! And does your project have any other dependencies on @types/validator? Like does it have multiple versions installed?
Googled this issue, and it looks like people have run into this issue over the years (even with class-validator specifically) with multiple versions with slightly incompatible definitions installed.
Only [email protected] and @types/[email protected] (13.11.8 when issue occurred)
from definitelytyped.
We fixed our projects adding to the package.json
"overrides": {
"@types/validator": "13.11.7"
}
we know it's a temporary solution until the bug is fixed.
from definitelytyped.
Hey folks. After some discussing on the PR, there isn't a way forward that both supplies the needed missing type information that was solved by #68121 and supports the specific style of import being used by class-validator. I have opened a downstream PR here: typestack/class-validator#2360
From looking at the class-validator project's issues, it looks like this flavor of issue has come up in the past, so this PR should fix it permanently.
from definitelytyped.
0.14.1 is now available on npm. I believe this issue can now be closed
from definitelytyped.
@kabamrrichman apologies! I'll take a look and work on a fix ASAP
from definitelytyped.
It looks like it's failing in class-validator package. What version are you using, so I can test?
from definitelytyped.
@kabamrrichman could you also share your TypeScript version? It looks like that package is just doing a default import, which is covered by tests:
from definitelytyped.
tsconfig.json would be great too!
from definitelytyped.
[email protected]
[email protected]
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"moduleResolution":"Node",
"target": "ES6",
"noImplicitAny": true,
"sourceMap": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"outDir": "./dist",
"noUncheckedIndexedAccess": true
}
from definitelytyped.
Thanks! And does your project have any other dependencies on @types/validator? Like does it have multiple versions installed?
Googled this issue, and it looks like people have run into this issue over the years (even with class-validator specifically) with multiple versions with slightly incompatible definitions installed.
from definitelytyped.
Issue happened due to bf9914f. In types/validator/index.d.ts, exporting is changed but not handled in validator package. with earlier version "@types/validator": "13.11.7", it will work.
from definitelytyped.
@dineshneoito the validator package isn't aware of these types at all. In general, @types packages are a promise that the backing JS package has a certain contract.
I'll try to repro today. It's a strange error because validator types have never had a namespace called ValidatorJS
from definitelytyped.
@marcovanetti @dineshneoito if you could also provide your tsconfig and TS versions, that would be great
from definitelytyped.
Is it possible to roll back this change and re-do it as a major version increase for @types/validator?
class-validator 0.14.0 has this dep: "@types/validator": "^13.9.0"
from definitelytyped.
I don't think so. Major bump would imply a new version of validator as well.
from definitelytyped.
To confirm, the choice is to let new installs of class-validator 0.14.0 to fail during builds and the solution is to wait until a new version of class-validator is released with your upstream changes?
from definitelytyped.
For the most part, types packages track their backing package major version and aren't versioned independently.
Generally speaking, @types packages can break without major version bumps. For example, next month this repo is scheduled to drop support for TS 4.6, which will not result in a major version bump of all @types packages. Going forward, packages could start using TS features only in 4.7+ without a major version bump, which could in fact break fresh installs.
For this reason, it's best practice use lock files. npm overrides / yarn package resolutions are also good tools here.
from definitelytyped.
Related Issues (20)
- Is it possible to support @types in snappyjs library? HOT 3
- http
- Definitions for cbor-js HOT 1
- [@types/react] The remove of onPointerEnterCapture caused unexpected errors. HOT 4
- [infra] CI "Format And Commit" job failing HOT 2
- leaflet.locatecontrol has an incorrect type in interface LocateOptions
- Routing Types Don't Match Spec HOT 1
- I have a problem with writing the interface definition of js-tokens. Please help. HOT 1
- [@types/shippo] Missing messages property on the Shipment interface HOT 1
- @types/selectize : Missing methods clearOptionGroups, removeOptionGroup and addItems HOT 1
- [aws-lambda] Potentially incorrect API Gateway Proxy types? HOT 1
- @types/node/stream.d.ts pipeline signature missing mandatory flag for callback HOT 1
- @types/validator does not have the isLicensePlate and isLuhnNumber interface definitions.
- [@types/selectize]: Missing parameter "silent" in methods clearOptions() and refreshItems() HOT 2
- Cannot use namespace as type
- @types/underscore does not provide type definitions for the isMap, isWeakMap,isSet,isWeakSet,toPath and restArguments interfaces. HOT 1
- version 4.17.1οΌthe type of the data variable is inferred to never by _.has HOT 6
- [@types/selectize]: Missing parameters $input and settings
- jwt.verify return void please check this
- this is unbelievable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from definitelytyped.