NextApiRequest'body property error when usr Turbopack #44319
Labels
bug
Issue was opened via the bug report template.
stale
The issue has not seen recent activity.
TypeScript
Related to types with Next.js.
Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64
Binaries:
Node: 16.19.0
npm: 9.2.0
Yarn: 1.22.17
pnpm: 7.18.2
Relevant packages:
next: 13.1.0
eslint-config-next: 13.0.7
react: 18.2.0
react-dom: 18.2.0
warn - Latest canary version not detected, detected: "13.1.0", newest: "13.1.1-canary.0".
Please try the latest canary version (
npm install next@canary
) to confirm the issue still exists before creating a new issue.Read more - https://nextjs.org/docs/messages/opening-an-issue
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), CLI (create-next-app), Turbopack (--turbo), TypeScript
Link to the code that reproduces this issue
unnecessary
To Reproduce
pnpm create next-app --experimental-app
and edit the pages/api/hellow.ts and a test page to call the fetch function
pnpm dev #(next dev --turbo)
Describe the Bug
In pages/api/lellow.ts
export default async function (req: NextApiRequest, res: NextApiResponse) { //this is'a string (--turbo),but without --turbo or build the project . this is an object (right) const data = req.body; }
Request headers and body
Content-Length: 54 Content-Type: application/json
{"account":"aa","password":"accdcdc","type":"account"}
Expected Behavior
req.body should be an object
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: