{"by_status":{"unconfirmed":[{"id":"8dda0d65-c576-4188-a15f-16e7fd5e78ee","slug":"express-typeerror-cannot-destructure-property-name-of-ab2b","url":"https://api.modalhub.ai/r/express-typeerror-cannot-destructure-property-name-of-ab2b","symptom":"TypeError: Cannot destructure property '<name>' of 'req.body' as it is undefined.","cause":"req.body is set only by a body parser whose type matches the request Content-Type; without a match Express 5 leaves it undefined (Express 4 used {})","tool":"express","version":"5.0.0","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"56dbafdf-b260-4c9b-8021-6a5c40dabfce","slug":"express-typeerror-missing-parameter-name-at-index-eb3e","url":"https://api.modalhub.ai/r/express-typeerror-missing-parameter-name-at-index-eb3e","symptom":"TypeError: Missing parameter name at index 1: *","cause":"Express 5 matches paths with path-to-regexp 8, where * is a named wildcard like :param, so a bare * has no name and the route throws at registration","tool":"express","version":"5.0.0","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}}]},"count":2,"dead_ends":[{"attempt":"default it away with const { name } = req.body || {}","why":"hides the real fault: name silently becomes undefined whenever the client omits Content-Type: application/json","reports":1,"record_url":"https://api.modalhub.ai/r/express-typeerror-cannot-destructure-property-name-of-ab2b"},{"attempt":"install body-parser and mount it next to express.json()","why":"express.json() already is body-parser; a second parser changes nothing when the Content-Type does not match","reports":1,"record_url":"https://api.modalhub.ai/r/express-typeerror-cannot-destructure-property-name-of-ab2b"},{"attempt":"rewrite the path as '(.*)' or '/api/(.*)'","why":"( and ) are reserved in Express 5 path strings and throw Unexpected ( at index 0; pass a real RegExp such as /.*/ if you need one","reports":1,"record_url":"https://api.modalhub.ai/r/express-typeerror-missing-parameter-name-at-index-eb3e"}],"tool":{"slug":"express","name":"express","records":2,"url":"https://api.modalhub.ai/t/express"}}
