Tsed: [BUG] Querying the default swagger route ends with "invalid status code: undefined"

Created on 18 Aug 2020  路  7Comments  路  Source: tsedio/tsed

Information

  • Version: 5.62.3
  • Packages: tsed

A few sentences describing the overall goals of the issue.

Example

After having started the scaffolded project I tried to open http://localhost:8083/docs which provoked an internal error.


[2020-08-18T14:35:21.223] [ERROR] [TSED] - {
  method: 'GET',
  url: '/docs',
  headers: {
    host: 'localhost:8083',
    connection: 'keep-alive',
    'cache-control': 'max-age=0',
    dnt: '1',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
      '(KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36 ' +
      'Edg/84.0.522.59',
    accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'sec-fetch-site': 'none',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-user': '?1',
    'sec-fetch-dest': 'document',
    'accept-encoding': 'gzip, deflate, br',
    'accept-language': 'en-US,en;q=0.9,de;q=0.8,de-DE;q=0.7,en-GB;q=0.6,fr;q=0.5',
  },
  body: undefined,
  query: {},
  params: {},
  reqId: '44198a456ece461492fb73a884ceca18',
  time: 2020-08-18T12:35:21.223Z,
  duration: 27,
  error: {
    status: 500,
    message: 'Invalid status code: undefined',
    stack: 'RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: ' +
      'undefined\n    at ServerResponse.writeHead (_http_server.js:220:11)\n    ' +
      'at ServerResponse.writeHead ' +
      '(C:\\....\\node_modules\\on-headers\\index.js:44:26)\n' +
      '    at ServerResponse._implicitHeader (_http_server.js:211:8)\n    at ' +
      'ServerResponse.end ' +
      '(C:\\...\\node_modules\\compression\\index.js:103:14)\n' +
      '    at ServerResponse.redirect ' +
      '(C:\\...\\node_modules\\express\\lib\\response.js:951:10)\n' +
      '    at ' +
      'C:\\...\\node_modules\\@tsed\\common\\lib\\mvc\\decorators\\method\\redirect.js:8:14\n' +
      '    at Layer.handle [as handle_request] ' +
      '(C:\\...\\node_modules\\express\\lib\\router\\layer.js:95:5)\n' +
      '    at next ' +
      '(C:\\...\\node_modules\\express\\lib\\router\\route.js:137:13)\n' +
      '    at Route.dispatch ' +
      '(C:\\...\\node_modules\\express\\lib\\router\\route.js:112:3)\n' +
      '    at Layer.handle [as handle_request] ' +
      '(C:\\...\\node_modules\\express\\lib\\router\\layer.js:95:5)',
    origin: undefined
  }
}

I used tsed init . to create this project. Querying for swagger's json file runs fine, no errors there.

I'm running node v12.0.0 and npm v6.9.0 on a Windows 10 x64.

bug released released on @alpha

All 7 comments

Another interesting thing to report is that when I clone v5.60.2 branch from https://github.com/TypedProject/tsed-getting-started and run it then no errors happen. But as soon as I update the packages (I use "npm-check -u" for that) the same error appears.

There must be some important difference between versions 5.60.2 and 5.62.3 (or any other of the packages that got updated too).

@brakmic Thanks for your issue. I recently updated v5 to prepare migration to the v6 version. I try to find the problem and fix the issue :)

Ok Got it. I fix that ;)

Awesome! Many thanks!

release is on going

:tada: This issue has been resolved in version 5.62.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

:tada: This issue has been resolved in version 6.0.0-alpha.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings