If you know how to fix the issue, make a pull request instead.
@types/express package and had problems.Definitions by: in index.d.ts) so they can respond.If you do not mention the authors the issue will be ignored.
Hello! Yesterday we deployed a production version of our application to all of our environments with success. Today, however, we are getting the following errors when we try to build and deploy our application again (the process removes the node_modules directory and installs the dependencies again). No code changes were involved.
.../node_modules/@types/express/index.d.ts(35,31): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(36,43): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(46,43): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(49,28): error TS2312: An interface may only extend a class or another interface.
We use the following @types packages:
"@types/async": "2.0.32",
"@types/browser-sync": "0.0.34",
"@types/core-js": "0.9.34",
"@types/express": "4.0.33",
"@types/gulp": "3.8.32",
"@types/gulp-filter": "3.0.29",
"@types/gulp-load-plugins": "0.0.28",
"@types/gulp-protractor": "1.0.29",
"@types/gulp-sass": "0.0.29",
"@types/gulp-util": "3.0.29",
"@types/jasmine": "2.5.35",
"@types/node": "^6.0.45",
"@types/protractor": "1.5.20",
"@types/rimraf": "0.0.28",
"@types/run-sequence": "0.0.28",
"@types/selenium-webdriver": "2.44.*",
"@types/systemjs": "0.19.31",
"@types/yargs": "0.0.34",
"@types/zone.js": "0.0.27",
"@types/lodash": "4.14.38"
Since we didn鈥檛 change anything on our side, we are wondering if anything could have changed that might be causing this issue. After trying to solve the issue and fail, I decided to post it. Also, I noticed that a dependency for the @types/express package (@types/express-serve-static-core) was published 19 hours ago. Could it be related?
Thanks,
Felipe Carvalho
I "fixed" the problem specifying the dependency to the previous version:
"@types/express-serve-static-core": "4.0.49"
@felipesoares93 I did the same thing to fix this issue but it is definitely really temporary.
[17:38:05] Starting 'copy.tizenSettings'...
[17:38:05] Finished 'copy.tizenSettings' after 78 ms
[17:38:05] Starting 'build.js.staging'...
C:/work/node_modules/@types/express/index.d.ts(35,31): error TS2312: An interface may only extend a class or another interface.
C:/work/node_modules/@types/express/index.d.ts(36,43): error TS2312: An interface may only extend a class or another interface.
C:/work/node_modules/@types/express/index.d.ts(46,43): error TS2312: An interface may only extend a class or another interface.
C:/work/node_modules/@types/express/index.d.ts(49,28): error TS2312: An interface may only extend a class or another interface.
[17:38:13] TypeScript: 4 semantic errors
[17:38:13] TypeScript: emit succeeded (with errors)
Facing same issue from two days and unable to build my project, When i am trying to install the previous version as you said getting other error, Can you guys help me out. It would be appreciated
I changed it i am able to build now
After changing too, I am getting the same errors
[16:45:41] Starting 'build.js.dev'...
.../node_modules/@types/express/index.d.ts(69,31): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(70,43): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(81,43): error TS2312: An interface may only extend a class or another interface.
.../node_modules/@types/express/index.d.ts(84,28): error TS2312: An interface may only extend a class or another interface.
[16:45:50] TypeScript: 4 semantic errors
[16:45:50] TypeScript: emit succeeded (with errors)
Can anyone help me with this
@praveen-nuovo did you remove your node_modules folder, forced a cache clean up, etc? And which is the @types package that you are getting the index.d.ts error? I did an investigation looking the git commits for the package with problem and all related dependencies, so my hint for you is to do the same for the package that is not working. Sorry for not being able to help much more on that
@felipesoares93 I removed node_modules folder, forced a cache clean up. But still getting the same errors.
Unable to build.
@felipesoares93
felipesoares93builder/build/node_modules/@types/express/index.d.ts(69,31): error TS2312: An interface may only extend a class or another interface.
builder/build/node_modules/@types/express/index.d.ts(70,43): error TS2312: An interface may only extend a class or another interface.
builder/build/node_modules/@types/express/index.d.ts(81,43): error TS2312: An interface may only extend a class or another interface.
builder/build/node_modules/@types/express/index.d.ts(84,28): error TS2312: An interface may only extend a class or another interface.
I have the same error message... I tried to downgrade express-serve-static-core, but it doesn't work.
Unable to build my project.
@JPSchellenberg 馃憤 Thanks!
@praveen-nuovo I was in the same position. Only worked after I reorganized my package.json to move all @types/* dependencies to devDependencies. Before that, @types/morgan was in dependencies, and was pulling the latest version of express-serve-static-core on its own.
@JPSchellenberg 馃憤 Worked.
I've traced the issue to this PR.
cc @andy-ms Can you please take a look on this?
@afr1983
For me, Fixed the problem specifying the dependency. Combination should be like this
"@types/express ": "4.0.33",
"@types/express-serve-static-core": "4.0.49"
@types/express requires a minimum TypeScript version of 2.2. The error you are getting only happens under TypeScript 2.1 or below.
If you want to continue using ts2.1 you should be able to specify in your package.json:
"@types/express": "ts2.1",
"@types/express-serve-static-core": "ts2.1",
I updated my typescript from 2.1 to 2.2 and it worked like a charm.
Thanks @andy-ms
"dependencies": {
. . . .
"typescript": "^2.2.2"
},
"devDependencies": {
. . . .
"@types/express": "^4.0.37",
"@types/express-serve-static-core": "^4.0.50",
}
node_modules/@types/express/index.d.ts(69,31): error TS2312: An interface may only extend a class or another interface.
node_modules/@types/express/index.d.ts(70,43): error TS2312: An interface may only extend a class or another interface.
node_modules/@types/express/index.d.ts(81,43): error TS2312: An interface may only extend a class or another interface.
node_modules/@types/express/index.d.ts(84,28): error TS2312: An interface may only extend a class or another interface.
I am enable to resolve this issue. guys help me!
Most helpful comment
@types/expressrequires a minimum TypeScript version of 2.2. The error you are getting only happens under TypeScript 2.1 or below.If you want to continue using ts2.1 you should be able to specify in your
package.json: