[Error]: Dynamic server usage: Route /api/properties/search couldn't be rendered statically because it used `request.url`

[Error]: Dynamic server usage: Route /api/properties/search couldn’t be rendered statically because it used request.url.

Generating static pages (11/14) [=== ]MongoDB connected successfully
MongoDB connected successfully
B [Error]: Dynamic server usage: Route /api/properties/search couldn’t be rendered statically because it used request.url. See more info here: DynamicServerError - Dynamic Server Usage | Next.js
at V (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:21777)
at Object.get (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:29137)
at u (D:\Full-Stack\LeaseLounge\leaselounge.next\server\app\api\properties\search\route.js:1:593)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:36938
at async eC.execute (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:27552)
at async eC.handle (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\compiled\next-server\app-route.runtime.prod.js:6:38272)
at async exportAppRoute (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\export\routes\app-route.js:77:26)
at async exportPageImpl (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\export\worker.js:175:20)
at async Span.traceAsyncFn (D:\Full-Stack\LeaseLounge\leaselounge\node_modules\next\dist\trace\trace.js:154:20) {
description: “Route /api/properties/search couldn’t be rendered statically because it used request.url. See more info here: DynamicServerError - Dynamic Server Usage | Next.js”,
digest: ‘DYNAMIC_SERVER_USAGE’
}

Hi @vishalthakur100. The error generally means a static page tried to use a dynamic function. The documentation has more details about why the error happened and how to fix it. :slightly_smiling_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.