next.js
456d8e7b - fix: ensure req.query is writable (#81573)

Commit
62 days ago
fix: ensure req.query is writable (#81573) ### What? - Upgrade development dependency **Express** to the latest version (5.1.0). - Replace direct assignment of `apiReq.query` with `Object.defineProperty` to ensure the property is writable, enumerable, and configurable. ### Why? - To use the most up-to-date and supported version of Express instead of a legacy one. - To fix [expressjs/express#6633](https://github.com/expressjs/express/issues/6633), where Express 5.x defines `req.query` as a read-only getter, preventing Next.js from overriding it directly. ### How? - Update the Express version in `package.json` and run `pnpm install` to apply the change. - Replace: ```js apiReq.query = query; ``` With ```js Object.defineProperty(apiReq, 'query', { value: { ...query }, writable: true, enumerable: true, configurable: true, }); ``` --------- Co-authored-by: Alessandro Grosselle <alessandro.grosselle@adevinta.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Author
Parents
Loading