next.js
79040a31 - [strict-route-types] Don't reject `number` in `config.api.bodyParser.sizeLimit` when validating route (#87633)

Commit
22 days ago
[strict-route-types] Don't reject `number` in `config.api.bodyParser.sizeLimit` when validating route (#87633) Not flagged behind `experimental.strictRouteTypes`. This is just a bug fix. Got revealed once we typechecked routes in pure Pages Router apps e.g. ``` .next/types/validator.ts:76:11 Type error: Type 'typeof import("~/pages/api/hello")' does not satisfy the expected type 'ApiRouteConfig'. The types of 'config.api.bodyParser' are incompatible between these types. Type 'false | { sizeLimit?: SizeLimit; }' is not assignable to type 'boolean | { sizeLimit?: string; }'. Type '{ sizeLimit?: SizeLimit; }' is not assignable to type 'boolean | { sizeLimit?: string; }'. Type '{ sizeLimit?: SizeLimit; }' is not assignable to type '{ sizeLimit?: string; }'. Types of property 'sizeLimit' are incompatible. Type 'SizeLimit' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. ``` -- https://github.com/vercel/next.js/actions/runs/20427462435/job/58690778302?pr=87628#step:32:562 Closes https://linear.app/vercel/issue/NXT-121
Author
Parents
Loading