@types/bluebird package and when building the project, it thew a hell of a lot of error."typescript": "2.7.2",
"extends": "../../tsconfig.json",
"compileOnSave": false,
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"moduleResolution": "node",
"outDir": "../../dist/server",
"baseUrl": "./",
"noEmitOnError": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"typeRoots": [
"node_modules/@types"
],
"types": [
"node", "express"
],
"lib": [
"es2015",
"dom"
]
},
"exclude": [
"node_modules",
]
$ tsc -p ./src/server/tsconfig.server.json
node_modules/@types/bluebird/index.d.ts(39,26): error TS1005: ';' expected.
node_modules/@types/bluebird/index.d.ts(39,34): error TS2693: 'Iterable' only refers to a type, but is beingused as a value here.
node_modules/@types/bluebird/index.d.ts(39,43): error TS2304: Cannot find name 'infer'.
node_modules/@types/bluebird/index.d.ts(39,49): error TS1005: ';' expected.
node_modules/@types/bluebird/index.d.ts(39,49): error TS2304: Cannot find name 'U'.
node_modules/@types/bluebird/index.d.ts(39,52): error TS1109: Expression expected.
node_modules/@types/bluebird/index.d.ts(39,54): error TS2304: Cannot find name 'U'.
node_modules/@types/bluebird/index.d.ts(39,58): error TS2693: 'never' only refers to a type, but is being used as a value here.
node_modules/@types/bluebird/index.d.ts(40,29): error TS1005: ';' expected.
node_modules/@types/bluebird/index.d.ts(40,37): error TS2693: 'Iterable' only refers to a type, but is being used as a value here.
node_modules/@types/bluebird/index.d.ts(40,51): error TS1005: '(' expected.
node_modules/@types/bluebird/index.d.ts(40,53): error TS2304: Cannot find name 'R'.
node_modules/@types/bluebird/index.d.ts(40,55): error TS1005: ',' expected.
node_modules/@types/bluebird/index.d.ts(40,57): error TS2693: 'never' only refers to a type, but is being used as a value here.
@nickjpanella v3.5.22 is working as intended:
It requires TypeScript v2.8 or later (see here), due to some very cool new typing features which got integrated (e.g. infer).
Until you upgrade TypeScript you can pin @types/bluebird to an older, working version, without missing anything significant out. 馃檪
~My mistake was that I forgot to demand a major version upgrade of the typings in the last PR.
I'm sorry for that.~ Nevermind. I forgot that with DefinitelyTyped the major/minor version of typings are always tied to the major/minor version of the project they're covering. In that case your only option now and in the future is to pin your typings to a version which you know is compatible to the TypeScript version you're using.
Same issue here. I'm using Angular CLI which requires a version of Typescript under 2.8
@nickjpanella @olivier-po @aeremin As mentioned in my comment above, this is _not_ an issue and the typings are _not_ "broken".
The newest Bluebird typings simply employ language features from the newest TypeScript version (>2.8) for increased type safety.
Let me put it this way: If you use the Bluebird v3.5.20 typings you had to use TypeScript 2.3 or later and if you tried using these with an older TypeScript version it would've failed the same way as described in this issue (>2.3 was required for the object type, which is an unknown identifier in older TypeScript versions).
@nickjpanella Due to these reasons you may close this issue now.
cc: @RyanCavanaugh
@lhecker Sorry, not meant to offend you (wasn't even aware that you will get notification here). It's definitely broken for me _personally_ - I am stuck at Typescript 2.3 due to some of my dependencies not supporting latest versions. Also it's a bit sad that @types/bluebird don't follow semver principle of not introducing breaking changes when changing patch version. Effectively, it breaks everybody using (bluebird + @types/bluebird) with older Typescript version, even if they depend on it indirectly (in my cases, npm decided to update @types/bluebird when doing clean 'npm install' on new machine).
@aeremin I actually agree that proper SemVer for typings would be greatly beneficial to prevent issues like this one.
But changing the current process would not in the least be a simple process and I'm not sure how one would go about it.
@RyanCavanaugh for instance already explained the situation quite extensively here.
Either way this is an entirely different issue though and e.g. #8735 and #25677 exist already.
If anyone has a cool way to solve this problem you could suggest it in a new issue or contribute to an existing one though. 馃檪
I have typescript 2.7.2, so using yarn info @types/bluebird I see that the @types/[email protected] dist-tag is 3.5.21, so I add to my package.json
"devDependencies": {
"@types/bluebird": "3.5.21",
},
and to prevent errors with @types/request-promise and @types/sequelize's dependencies on
@types/bluebird, also adding
"resolutions": {
"@types/bluebird": "3.5.21"
},
worked for me
Most helpful comment
@nickjpanella v3.5.22 is working as intended:
It requires TypeScript v2.8 or later (see here), due to some very cool new typing features which got integrated (e.g.
infer).Until you upgrade TypeScript you can pin
@types/bluebirdto an older, working version, without missing anything significant out. 馃檪~My mistake was that I forgot to demand a major version upgrade of the typings in the last PR.
I'm sorry for that.~ Nevermind. I forgot that with DefinitelyTyped the major/minor version of typings are always tied to the major/minor version of the project they're covering. In that case your only option now and in the future is to pin your typings to a version which you know is compatible to the TypeScript version you're using.