-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Labels
Description
Describe the bug
When I try to access the "request" variable inside app route api route, it throw "Error: The request.page has been deprecated in favour of URLPattern
"
Steps to reproduce
- create a route.ts file under app/api/
- Define a put request
export async function PUT (
request: Request, context: { params: Params },
) {
console.log(request)
}
- send a put request
The output of "request" is:
<Formatting threw (Error: The request.page has been deprecated in favour of `URLPattern`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
at get page (file:///Users/baozier/Projects/melody-auth/admin-panel/.open-next/server-functions/default/handler.mjs:10834:15)
at Reflect.get (<anonymous>)
at R.get (file:///Users/baozier/Projects/melody-auth/admin-panel/.open-next/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:10781)
at Object.get (file:///Users/baozier/Projects/melody-auth/admin-panel/.open-next/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:29248)
at Proxy.formatJsgResourceType (node-internal:internal_inspect:2383:31)
at formatValue (node-internal:internal_inspect:813:49)
at inspect (node-internal:internal_inspect:397:12)
at formatWithOptionsInternal (node-internal:internal_inspect:2229:44)
at formatWithOptions (node-internal:internal_inspect:2093:12)
at formatLog (node-internal:internal_inspect:2318:16))>
Expected behavior
Should not throw error
@opennextjs/cloudflare version
experimental
Node.js version
22.x
Wrangler version
3.95.0
next info output
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 22.6.0
npm: 10.8.2
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.2.14 // An outdated version detected (latest is 15.1.0), upgrade is highly recommended!
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 5.5.4
Next.js Config:
output: N/A
Additional context
No response