Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
67 KiB
Text
1 line
No EOL
67 KiB
Text
{"version":3,"sources":["../../../../src/server/route-modules/app-route/module.ts"],"sourcesContent":["import type { NextConfig } from '../../config-shared'\nimport type { AppRouteRouteDefinition } from '../../route-definitions/app-route-route-definition'\nimport type { AppSegmentConfig } from '../../../build/segment-config/app/app-segment-config'\nimport type { NextRequest } from '../../web/spec-extension/request'\nimport type { PrerenderManifest } from '../../../build'\nimport type { NextURL } from '../../web/next-url'\nimport type { DeepReadonly } from '../../../shared/lib/deep-readonly'\nimport type { WorkUnitStore } from '../../app-render/work-unit-async-storage.external'\n\nimport {\n RouteModule,\n type RouteModuleHandleContext,\n type RouteModuleOptions,\n} from '../route-module'\nimport { createRequestStoreForAPI } from '../../async-storage/request-store'\nimport {\n createWorkStore,\n type WorkStoreContext,\n} from '../../async-storage/work-store'\nimport { type HTTP_METHOD, HTTP_METHODS, isHTTPMethod } from '../../web/http'\nimport { getImplicitTags, type ImplicitTags } from '../../lib/implicit-tags'\nimport { patchFetch } from '../../lib/patch-fetch'\nimport { getTracer } from '../../lib/trace/tracer'\nimport { AppRouteRouteHandlersSpan } from '../../lib/trace/constants'\nimport * as Log from '../../../build/output/log'\nimport { autoImplementMethods } from './helpers/auto-implement-methods'\nimport {\n appendMutableCookies,\n type ReadonlyRequestCookies,\n} from '../../web/spec-extension/adapters/request-cookies'\nimport { HeadersAdapter } from '../../web/spec-extension/adapters/headers'\nimport { RequestCookiesAdapter } from '../../web/spec-extension/adapters/request-cookies'\nimport { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params'\nimport { printDebugThrownValueForProspectiveRender } from '../../app-render/prospective-render-utils'\n\nimport * as serverHooks from '../../../client/components/hooks-server-context'\nimport { DynamicServerError } from '../../../client/components/hooks-server-context'\n\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../../app-render/work-async-storage.external'\nimport {\n workUnitAsyncStorage,\n type RequestStore,\n type PrerenderStore,\n} from '../../app-render/work-unit-async-storage.external'\nimport {\n actionAsyncStorage,\n type ActionStore,\n} from '../../app-render/action-async-storage.external'\nimport * as sharedModules from './shared-modules'\nimport { getIsPossibleServerAction } from '../../lib/server-action-request-meta'\nimport { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies'\nimport { cleanURL } from './helpers/clean-url'\nimport { StaticGenBailoutError } from '../../../client/components/static-generation-bailout'\nimport { isStaticGenEnabled } from './helpers/is-static-gen-enabled'\nimport {\n abortAndThrowOnSynchronousRequestDataAccess,\n postponeWithTracking,\n createDynamicTrackingState,\n getFirstDynamicReason,\n} from '../../app-render/dynamic-rendering'\nimport { ReflectAdapter } from '../../web/spec-extension/adapters/reflect'\nimport type { RenderOptsPartial } from '../../app-render/types'\nimport { CacheSignal } from '../../app-render/cache-signal'\nimport { scheduleImmediate } from '../../../lib/scheduler'\nimport { createServerParamsForRoute } from '../../request/params'\nimport type { AppSegment } from '../../../build/segment-config/app/app-segments'\nimport {\n getRedirectStatusCodeFromError,\n getURLFromRedirectError,\n} from '../../../client/components/redirect'\nimport {\n isRedirectError,\n type RedirectError,\n} from '../../../client/components/redirect-error'\nimport {\n getAccessFallbackHTTPStatus,\n isHTTPAccessFallbackError,\n} from '../../../client/components/http-access-fallback/http-access-fallback'\nimport { RedirectStatusCode } from '../../../client/components/redirect-status-code'\nimport { INFINITE_CACHE } from '../../../lib/constants'\nimport { executeRevalidates } from '../../revalidation-utils'\nimport { trackPendingModules } from '../../app-render/module-loading/track-module-loading.external'\nimport { InvariantError } from '../../../shared/lib/invariant-error'\nimport { createPrerenderResumeDataCache } from '../../resume-data-cache/resume-data-cache'\n\nexport class WrappedNextRouterError {\n constructor(\n public readonly error: RedirectError,\n public readonly headers?: Headers\n ) {}\n}\n\n/**\n * The AppRouteModule is the type of the module exported by the bundled App\n * Route module.\n */\nexport type AppRouteModule = typeof import('../../../build/templates/app-route')\n\nexport type AppRouteSharedContext = {\n buildId: string\n}\n\n/**\n * AppRouteRouteHandlerContext is the context that is passed to the route\n * handler for app routes.\n */\nexport interface AppRouteRouteHandlerContext extends RouteModuleHandleContext {\n renderOpts: WorkStoreContext['renderOpts'] &\n Pick<RenderOptsPartial, 'onInstrumentationRequestError'> &\n CollectedCacheInfo\n prerenderManifest: DeepReadonly<PrerenderManifest>\n sharedContext: AppRouteSharedContext\n}\n\ntype CollectedCacheInfo = {\n collectedTags?: string\n collectedRevalidate?: number\n collectedExpire?: number\n collectedStale?: number\n}\n\n/**\n * AppRouteHandlerFnContext is the context that is passed to the handler as the\n * second argument.\n */\ntype AppRouteHandlerFnContext = {\n params?: Promise<Record<string, string | string[] | undefined>>\n}\n\n/**\n * Handler function for app routes. If a non-Response value is returned, an error\n * will be thrown.\n */\nexport type AppRouteHandlerFn = (\n /**\n * Incoming request object.\n */\n req: NextRequest,\n /**\n * Context properties on the request (including the parameters if this was a\n * dynamic route).\n */\n ctx: AppRouteHandlerFnContext\n) => unknown\n\n/**\n * AppRouteHandlers describes the handlers for app routes that is provided by\n * the userland module.\n */\nexport type AppRouteHandlers = {\n [method in HTTP_METHOD]?: AppRouteHandlerFn\n}\n\n/**\n * AppRouteUserlandModule is the userland module that is provided for app\n * routes. This contains all the user generated code.\n */\nexport type AppRouteUserlandModule = AppRouteHandlers &\n Pick<\n AppSegmentConfig,\n 'dynamic' | 'revalidate' | 'dynamicParams' | 'fetchCache'\n > &\n Pick<AppSegment, 'generateStaticParams'>\n\n/**\n * AppRouteRouteModuleOptions is the options that are passed to the app route\n * module from the bundled code.\n */\nexport interface AppRouteRouteModuleOptions\n extends RouteModuleOptions<AppRouteRouteDefinition, AppRouteUserlandModule> {\n readonly resolvedPagePath: string\n readonly nextConfigOutput: NextConfig['output']\n}\n\n/**\n * AppRouteRouteHandler is the handler for app routes.\n */\nexport class AppRouteRouteModule extends RouteModule<\n AppRouteRouteDefinition,\n AppRouteUserlandModule\n> {\n /**\n * A reference to the request async storage.\n */\n public readonly workUnitAsyncStorage = workUnitAsyncStorage\n\n /**\n * A reference to the static generation async storage.\n */\n public readonly workAsyncStorage = workAsyncStorage\n\n /**\n * An interface to call server hooks which interact with the underlying\n * storage.\n */\n public readonly serverHooks = serverHooks\n\n public static readonly sharedModules = sharedModules\n\n /**\n * A reference to the mutation related async storage, such as mutations of\n * cookies.\n */\n public readonly actionAsyncStorage = actionAsyncStorage\n\n public readonly resolvedPagePath: string\n public readonly nextConfigOutput: NextConfig['output'] | undefined\n\n private readonly methods: Record<HTTP_METHOD, AppRouteHandlerFn>\n private readonly hasNonStaticMethods: boolean\n private readonly dynamic: AppRouteUserlandModule['dynamic']\n\n constructor({\n userland,\n definition,\n distDir,\n relativeProjectDir,\n resolvedPagePath,\n nextConfigOutput,\n }: AppRouteRouteModuleOptions) {\n super({ userland, definition, distDir, relativeProjectDir })\n\n this.resolvedPagePath = resolvedPagePath\n this.nextConfigOutput = nextConfigOutput\n\n // Automatically implement some methods if they aren't implemented by the\n // userland module.\n this.methods = autoImplementMethods(userland)\n\n // Get the non-static methods for this route.\n this.hasNonStaticMethods = hasNonStaticMethods(userland)\n\n // Get the dynamic property from the userland module.\n this.dynamic = this.userland.dynamic\n if (this.nextConfigOutput === 'export') {\n if (this.dynamic === 'force-dynamic') {\n throw new Error(\n `export const dynamic = \"force-dynamic\" on page \"${definition.pathname}\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`\n )\n } else if (!isStaticGenEnabled(this.userland) && this.userland['GET']) {\n throw new Error(\n `export const dynamic = \"force-static\"/export const revalidate not configured on route \"${definition.pathname}\" with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export`\n )\n } else {\n this.dynamic = 'error'\n }\n }\n\n // We only warn in development after here, so return if we're not in\n // development.\n if (process.env.NODE_ENV === 'development') {\n // Print error in development if the exported handlers are in lowercase, only\n // uppercase handlers are supported.\n const lowercased = HTTP_METHODS.map((method) => method.toLowerCase())\n for (const method of lowercased) {\n if (method in this.userland) {\n Log.error(\n `Detected lowercase method '${method}' in '${\n this.resolvedPagePath\n }'. Export the uppercase '${method.toUpperCase()}' method name to fix this error.`\n )\n }\n }\n\n // Print error if the module exports a default handler, they must use named\n // exports for each HTTP method.\n if ('default' in this.userland) {\n Log.error(\n `Detected default export in '${this.resolvedPagePath}'. Export a named export for each HTTP method instead.`\n )\n }\n\n // If there is no methods exported by this module, then return a not found\n // response.\n if (!HTTP_METHODS.some((method) => method in this.userland)) {\n Log.error(\n `No HTTP methods exported in '${this.resolvedPagePath}'. Export a named export for each HTTP method.`\n )\n }\n }\n }\n\n /**\n * Resolves the handler function for the given method.\n *\n * @param method the requested method\n * @returns the handler function for the given method\n */\n private resolve(method: string): AppRouteHandlerFn {\n // Ensure that the requested method is a valid method (to prevent RCE's).\n if (!isHTTPMethod(method)) return () => new Response(null, { status: 400 })\n\n // Return the handler.\n return this.methods[method]\n }\n\n private async do(\n handler: AppRouteHandlerFn,\n actionStore: ActionStore,\n workStore: WorkStore,\n // @TODO refactor to not take this argument but instead construct the RequestStore\n // inside this function. Right now we get passed a RequestStore even when\n // we're going to do a prerender. We should probably just split do up into prexecute and execute\n requestStore: RequestStore,\n implicitTags: ImplicitTags,\n request: NextRequest,\n context: AppRouteRouteHandlerContext\n ) {\n const isStaticGeneration = workStore.isStaticGeneration\n const cacheComponentsEnabled = !!context.renderOpts.cacheComponents\n\n // Patch the global fetch.\n patchFetch({\n workAsyncStorage: this.workAsyncStorage,\n workUnitAsyncStorage: this.workUnitAsyncStorage,\n })\n\n const handlerContext: AppRouteHandlerFnContext = {\n params: context.params\n ? createServerParamsForRoute(\n parsedUrlQueryToParams(context.params),\n workStore\n )\n : undefined,\n }\n\n const resolvePendingRevalidations = () => {\n context.renderOpts.pendingWaitUntil = executeRevalidates(\n workStore\n ).finally(() => {\n if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {\n console.log(\n 'pending revalidates promise finished for:',\n requestStore.url\n )\n }\n })\n }\n\n let prerenderStore: null | PrerenderStore = null\n\n let res: unknown\n try {\n if (isStaticGeneration) {\n const userlandRevalidate = this.userland.revalidate\n const defaultRevalidate: number =\n // If the static generation store does not have a revalidate value\n // set, then we should set it the revalidate value from the userland\n // module or default to false.\n userlandRevalidate === false || userlandRevalidate === undefined\n ? INFINITE_CACHE\n : userlandRevalidate\n\n if (cacheComponentsEnabled) {\n /**\n * When we are attempting to statically prerender the GET handler of a route.ts module\n * and cacheComponents is on we follow a similar pattern to rendering.\n *\n * We first run the handler letting caches fill. If something synchronously dynamic occurs\n * during this prospective render then we can infer it will happen on every render and we\n * just bail out of prerendering.\n *\n * Next we run the handler again and we check if we get a result back in a microtask.\n * Next.js expects the return value to be a Response or a Thenable that resolves to a Response.\n * Unfortunately Response's do not allow for accessing the response body synchronously or in\n * a microtask so we need to allow one more task to unwrap the response body. This is a slightly\n * different semantic than what we have when we render and it means that certain tasks can still\n * execute before a prerender completes such as a carefully timed setImmediate.\n *\n * Functionally though IO should still take longer than the time it takes to unwrap the response body\n * so our heuristic of excluding any IO should be preserved.\n */\n const prospectiveController = new AbortController()\n let prospectiveRenderIsDynamic = false\n const cacheSignal = new CacheSignal()\n let dynamicTracking = createDynamicTrackingState(undefined)\n\n // TODO: Route handlers are never resumed, so it's counter-intuitive\n // to use an RDC here. However, we need the data cache to store cached\n // results in memory during the prospective prerender, so that they\n // can be retrieved during the final prerender within microtasks. This\n // is crucial when doing revalidations of a deployed route handler,\n // where the default cache handler does not do any in-memory caching.\n // We should replace the `prerenderResumeDataCache` and\n // `renderResumeDataCache` with a single `dataCache` property that is\n // conceptually not tied to resuming, and also avoids the unnecessary\n // complexity of using a mutable and an immutable resume data cache.\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n\n const prospectiveRoutePrerenderStore: PrerenderStore =\n (prerenderStore = {\n type: 'prerender',\n phase: 'action',\n // This replicates prior behavior where rootParams is empty in routes\n // TODO we need to make this have the proper rootParams for this route\n rootParams: {},\n fallbackRouteParams: null,\n implicitTags,\n renderSignal: prospectiveController.signal,\n controller: prospectiveController,\n cacheSignal,\n // During prospective render we don't use a controller\n // because we need to let all caches fill.\n dynamicTracking,\n allowEmptyStaticShell: false,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined,\n })\n\n let prospectiveResult\n try {\n prospectiveResult = this.workUnitAsyncStorage.run(\n prospectiveRoutePrerenderStore,\n handler,\n request,\n handlerContext\n )\n } catch (err) {\n if (prospectiveController.signal.aborted) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n prospectiveRenderIsDynamic = true\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n }\n if (\n typeof prospectiveResult === 'object' &&\n prospectiveResult !== null &&\n typeof (prospectiveResult as any).then === 'function'\n ) {\n // The handler returned a Thenable. We'll listen for rejections to determine\n // if the route is erroring for dynamic reasons.\n ;(prospectiveResult as any as Promise<unknown>).then(\n () => {},\n (err) => {\n if (prospectiveController.signal.aborted) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n prospectiveRenderIsDynamic = true\n } else if (process.env.NEXT_DEBUG_BUILD) {\n printDebugThrownValueForProspectiveRender(\n err,\n workStore.route\n )\n }\n }\n )\n }\n\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n\n if (prospectiveRenderIsDynamic) {\n // the route handler called an API which is always dynamic\n // there is no need to try again\n const dynamicReason = getFirstDynamicReason(dynamicTracking)\n if (dynamicReason) {\n throw new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used \\`${dynamicReason}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n } else {\n console.error(\n 'Expected Next.js to keep track of reason for opting out of static rendering but one was not found. This is a bug in Next.js'\n )\n throw new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used a dynamic API. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n }\n }\n\n // TODO start passing this controller to the route handler. We should expose\n // it so the handler to abort inflight requests and other operations if we abort\n // the prerender.\n const finalController = new AbortController()\n dynamicTracking = createDynamicTrackingState(undefined)\n\n const finalRoutePrerenderStore: PrerenderStore = (prerenderStore = {\n type: 'prerender',\n phase: 'action',\n rootParams: {},\n fallbackRouteParams: null,\n implicitTags,\n renderSignal: finalController.signal,\n controller: finalController,\n cacheSignal: null,\n dynamicTracking,\n allowEmptyStaticShell: false,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined,\n })\n\n let responseHandled = false\n res = await new Promise((resolve, reject) => {\n scheduleImmediate(async () => {\n try {\n const result = await (this.workUnitAsyncStorage.run(\n finalRoutePrerenderStore,\n handler,\n request,\n handlerContext\n ) as Promise<Response>)\n if (responseHandled) {\n // we already rejected in the followup task\n return\n } else if (!(result instanceof Response)) {\n // This is going to error but we let that happen below\n resolve(result)\n return\n }\n\n responseHandled = true\n\n let bodyHandled = false\n result.arrayBuffer().then((body) => {\n if (!bodyHandled) {\n bodyHandled = true\n\n resolve(\n new Response(body, {\n headers: result.headers,\n status: result.status,\n statusText: result.statusText,\n })\n )\n }\n }, reject)\n scheduleImmediate(() => {\n if (!bodyHandled) {\n bodyHandled = true\n finalController.abort()\n reject(createCacheComponentsError(workStore.route))\n }\n })\n } catch (err) {\n reject(err)\n }\n })\n scheduleImmediate(() => {\n if (!responseHandled) {\n responseHandled = true\n finalController.abort()\n reject(createCacheComponentsError(workStore.route))\n }\n })\n })\n if (finalController.signal.aborted) {\n // We aborted from within the execution\n throw createCacheComponentsError(workStore.route)\n } else {\n // We didn't abort during the execution. We can abort now as a matter of semantics\n // though at the moment nothing actually consumes this signal so it won't halt any\n // inflight work.\n finalController.abort()\n }\n } else {\n prerenderStore = {\n type: 'prerender-legacy',\n phase: 'action',\n rootParams: {},\n implicitTags,\n revalidate: defaultRevalidate,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n }\n\n res = await workUnitAsyncStorage.run(\n prerenderStore,\n handler,\n request,\n handlerContext\n )\n }\n } else {\n res = await workUnitAsyncStorage.run(\n requestStore,\n handler,\n request,\n handlerContext\n )\n }\n } catch (err) {\n if (isRedirectError(err)) {\n const url = getURLFromRedirectError(err)\n if (!url) {\n throw new Error('Invariant: Unexpected redirect url format')\n }\n\n // We need to capture any headers that should be sent on\n // the response.\n const headers = new Headers({ Location: url })\n\n // Let's append any cookies that were added by the\n // cookie API.\n // TODO leaving the gate here b/c it indicates that we might not actually want to do this\n // on every `do` call. During prerender there should be no mutableCookies because\n appendMutableCookies(headers, requestStore.mutableCookies)\n\n resolvePendingRevalidations()\n\n // Return the redirect response.\n return new Response(null, {\n // If we're in an action, we want to use a 303 redirect as we don't\n // want the POST request to follow the redirect, as it could result in\n // erroneous re-submissions.\n status: actionStore.isAction\n ? RedirectStatusCode.SeeOther\n : getRedirectStatusCodeFromError(err),\n headers,\n })\n } else if (isHTTPAccessFallbackError(err)) {\n const httpStatus = getAccessFallbackHTTPStatus(err)\n return new Response(null, { status: httpStatus })\n }\n\n throw err\n }\n\n // Validate that the response is a valid response object.\n if (!(res instanceof Response)) {\n throw new Error(\n `No response is returned from route handler '${this.resolvedPagePath}'. Ensure you return a \\`Response\\` or a \\`NextResponse\\` in all branches of your handler.`\n )\n }\n\n context.renderOpts.fetchMetrics = workStore.fetchMetrics\n\n resolvePendingRevalidations()\n\n if (prerenderStore) {\n context.renderOpts.collectedTags = prerenderStore.tags?.join(',')\n context.renderOpts.collectedRevalidate = prerenderStore.revalidate\n context.renderOpts.collectedExpire = prerenderStore.expire\n context.renderOpts.collectedStale = prerenderStore.stale\n }\n\n // It's possible cookies were set in the handler, so we need\n // to merge the modified cookies and the returned response\n // here.\n const headers = new Headers(res.headers)\n if (appendMutableCookies(headers, requestStore.mutableCookies)) {\n return new Response(res.body, {\n status: res.status,\n statusText: res.statusText,\n headers,\n })\n }\n\n return res\n }\n\n public async handle(\n req: NextRequest,\n context: AppRouteRouteHandlerContext\n ): Promise<Response> {\n // Get the handler function for the given method.\n const handler = this.resolve(req.method)\n\n // Get the context for the static generation.\n const staticGenerationContext: WorkStoreContext = {\n page: this.definition.page,\n renderOpts: context.renderOpts,\n buildId: context.sharedContext.buildId,\n previouslyRevalidatedTags: [],\n }\n\n // Add the fetchCache option to the renderOpts.\n staticGenerationContext.renderOpts.fetchCache = this.userland.fetchCache\n\n const actionStore: ActionStore = {\n isAppRoute: true,\n isAction: getIsPossibleServerAction(req),\n }\n\n const implicitTags = await getImplicitTags(\n this.definition.page,\n req.nextUrl,\n // App Routes don't support unknown route params.\n null\n )\n\n const requestStore = createRequestStoreForAPI(\n req,\n req.nextUrl,\n implicitTags,\n undefined,\n context.prerenderManifest.preview\n )\n\n const workStore = createWorkStore(staticGenerationContext)\n\n // Run the handler with the request AsyncLocalStorage to inject the helper\n // support. We set this to `unknown` because the type is not known until\n // runtime when we do a instanceof check below.\n const response: unknown = await this.actionAsyncStorage.run(\n actionStore,\n () =>\n this.workUnitAsyncStorage.run(requestStore, () =>\n this.workAsyncStorage.run(workStore, async () => {\n // Check to see if we should bail out of static generation based on\n // having non-static methods.\n if (this.hasNonStaticMethods) {\n if (workStore.isStaticGeneration) {\n const err = new DynamicServerError(\n 'Route is configured with methods that cannot be statically generated.'\n )\n workStore.dynamicUsageDescription = err.message\n workStore.dynamicUsageStack = err.stack\n throw err\n }\n }\n\n // We assume we can pass the original request through however we may end up\n // proxying it in certain circumstances based on execution type and configuration\n let request = req\n\n // Update the static generation store based on the dynamic property.\n switch (this.dynamic) {\n case 'force-dynamic': {\n // Routes of generated paths should be dynamic\n workStore.forceDynamic = true\n if (workStore.isStaticGeneration) {\n const err = new DynamicServerError(\n 'Route is configured with dynamic = error which cannot be statically generated.'\n )\n workStore.dynamicUsageDescription = err.message\n workStore.dynamicUsageStack = err.stack\n throw err\n }\n break\n }\n case 'force-static':\n // The dynamic property is set to force-static, so we should\n // force the page to be static.\n workStore.forceStatic = true\n // We also Proxy the request to replace dynamic data on the request\n // with empty stubs to allow for safely executing as static\n request = new Proxy(req, forceStaticRequestHandlers)\n break\n case 'error':\n // The dynamic property is set to error, so we should throw an\n // error if the page is being statically generated.\n workStore.dynamicShouldError = true\n if (workStore.isStaticGeneration)\n request = new Proxy(req, requireStaticRequestHandlers)\n break\n case undefined:\n case 'auto':\n // We proxy `NextRequest` to track dynamic access, and\n // potentially bail out of static generation.\n request = proxyNextRequest(req, workStore)\n break\n default:\n this.dynamic satisfies never\n }\n\n const tracer = getTracer()\n\n // Update the root span attribute for the route.\n const { pathname } = this.definition\n tracer.setRootSpanAttribute('next.route', pathname)\n\n return tracer.trace(\n AppRouteRouteHandlersSpan.runHandler,\n {\n spanName: `executing api route (app) ${pathname}`,\n attributes: {\n 'next.route': pathname,\n },\n },\n async () =>\n this.do(\n handler,\n actionStore,\n workStore,\n requestStore,\n implicitTags,\n request,\n context\n )\n )\n })\n )\n )\n\n // If the handler did't return a valid response, then return the internal\n // error response.\n if (!(response instanceof Response)) {\n // TODO: validate the correct handling behavior, maybe log something?\n return new Response(null, { status: 500 })\n }\n\n if (response.headers.has('x-middleware-rewrite')) {\n throw new Error(\n 'NextResponse.rewrite() was used in a app route handler, this is not currently supported. Please remove the invocation to continue.'\n )\n }\n\n if (response.headers.get('x-middleware-next') === '1') {\n // TODO: move this error into the `NextResponse.next()` function.\n throw new Error(\n 'NextResponse.next() was used in a app route handler, this is not supported. See here for more info: https://nextjs.org/docs/messages/next-response-next-in-app-route-handler'\n )\n }\n\n return response\n }\n}\n\nexport default AppRouteRouteModule\n\n/**\n * Gets all the method names for handlers that are not considered static.\n *\n * @param handlers the handlers from the userland module\n * @returns the method names that are not considered static or false if all\n * methods are static\n */\nexport function hasNonStaticMethods(handlers: AppRouteHandlers): boolean {\n if (\n // Order these by how common they are to be used\n handlers.POST ||\n handlers.PUT ||\n handlers.DELETE ||\n handlers.PATCH ||\n handlers.OPTIONS\n ) {\n return true\n }\n return false\n}\n\n// These symbols will be used to stash cached values on Proxied requests without requiring\n// additional closures or storage such as WeakMaps.\nconst nextURLSymbol = Symbol('nextUrl')\nconst requestCloneSymbol = Symbol('clone')\nconst urlCloneSymbol = Symbol('clone')\nconst searchParamsSymbol = Symbol('searchParams')\nconst hrefSymbol = Symbol('href')\nconst toStringSymbol = Symbol('toString')\nconst headersSymbol = Symbol('headers')\nconst cookiesSymbol = Symbol('cookies')\n\ntype RequestSymbolTarget = {\n [headersSymbol]?: Headers\n [cookiesSymbol]?: RequestCookies | ReadonlyRequestCookies\n [nextURLSymbol]?: NextURL\n [requestCloneSymbol]?: () => NextRequest\n}\n\ntype UrlSymbolTarget = {\n [searchParamsSymbol]?: URLSearchParams\n [hrefSymbol]?: string\n [toStringSymbol]?: () => string\n [urlCloneSymbol]?: () => NextURL\n}\n\n/**\n * The general technique with these proxy handlers is to prioritize keeping them static\n * by stashing computed values on the Proxy itself. This is safe because the Proxy is\n * inaccessible to the consumer since all operations are forwarded\n */\nconst forceStaticRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'headers':\n return (\n target[headersSymbol] ||\n (target[headersSymbol] = HeadersAdapter.seal(new Headers({})))\n )\n case 'cookies':\n return (\n target[cookiesSymbol] ||\n (target[cookiesSymbol] = RequestCookiesAdapter.seal(\n new RequestCookies(new Headers({}))\n ))\n )\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(\n target.nextUrl,\n forceStaticNextUrlHandlers\n ))\n )\n case 'url':\n // we don't need to separately cache this we can just read the nextUrl\n // and return the href since we know it will have been stripped of any\n // dynamic parts. We access via the receiver to trigger the get trap\n return receiver.nextUrl.href\n case 'geo':\n case 'ip':\n return undefined\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n forceStaticRequestHandlers\n ))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n}\n\nconst forceStaticNextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n // URL properties\n case 'search':\n return ''\n case 'searchParams':\n return (\n target[searchParamsSymbol] ||\n (target[searchParamsSymbol] = new URLSearchParams())\n )\n case 'href':\n return (\n target[hrefSymbol] ||\n (target[hrefSymbol] = cleanURL(target.href).href)\n )\n case 'toJSON':\n case 'toString':\n return (\n target[toStringSymbol] ||\n (target[toStringSymbol] = () => receiver.href)\n )\n\n // NextUrl properties\n case 'url':\n // Currently nextURL does not expose url but our Docs indicate that it is an available property\n // I am forcing this to undefined here to avoid accidentally exposing a dynamic value later if\n // the underlying nextURL ends up adding this property\n return undefined\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), forceStaticNextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n}\n\nfunction proxyNextRequest(request: NextRequest, workStore: WorkStore) {\n const nextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'search':\n case 'searchParams':\n case 'url':\n case 'href':\n case 'toJSON':\n case 'toString':\n case 'origin': {\n const workUnitStore = workUnitAsyncStorage.getStore()\n trackDynamic(workStore, workUnitStore, `nextUrl.${prop}`)\n return ReflectAdapter.get(target, prop, receiver)\n }\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), nextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n }\n\n const nextRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol\n ): unknown {\n switch (prop) {\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(target.nextUrl, nextUrlHandlers))\n )\n case 'headers':\n case 'cookies':\n case 'url':\n case 'body':\n case 'blob':\n case 'json':\n case 'text':\n case 'arrayBuffer':\n case 'formData': {\n const workUnitStore = workUnitAsyncStorage.getStore()\n trackDynamic(workStore, workUnitStore, `request.${prop}`)\n // The receiver arg is intentionally the same as the target to fix an issue with\n // edge runtime, where attempting to access internal slots with the wrong `this` context\n // results in an error.\n return ReflectAdapter.get(target, prop, target)\n }\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n nextRequestHandlers\n ))\n )\n default:\n // The receiver arg is intentionally the same as the target to fix an issue with\n // edge runtime, where attempting to access internal slots with the wrong `this` context\n // results in an error.\n return ReflectAdapter.get(target, prop, target)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n }\n\n return new Proxy(request, nextRequestHandlers)\n}\n\nconst requireStaticRequestHandlers = {\n get(\n target: NextRequest & RequestSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'nextUrl':\n return (\n target[nextURLSymbol] ||\n (target[nextURLSymbol] = new Proxy(\n target.nextUrl,\n requireStaticNextUrlHandlers\n ))\n )\n case 'headers':\n case 'cookies':\n case 'url':\n case 'body':\n case 'blob':\n case 'json':\n case 'text':\n case 'arrayBuffer':\n case 'formData':\n throw new StaticGenBailoutError(\n `Route ${target.nextUrl.pathname} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`request.${prop}\\`.`\n )\n case 'clone':\n return (\n target[requestCloneSymbol] ||\n (target[requestCloneSymbol] = () =>\n new Proxy(\n // This is vaguely unsafe but it's required since NextRequest does not implement\n // clone. The reason we might expect this to work in this context is the Proxy will\n // respond with static-amenable values anyway somewhat restoring the interface.\n // @TODO we need to rethink NextRequest and NextURL because they are not sufficientlly\n // sophisticated to adequately represent themselves in all contexts. A better approach is\n // to probably embed the static generation logic into the class itself removing the need\n // for any kind of proxying\n target.clone() as NextRequest,\n requireStaticRequestHandlers\n ))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n // We don't need to proxy set because all the properties we proxy are ready only\n // and will be ignored\n}\n\nconst requireStaticNextUrlHandlers = {\n get(\n target: NextURL & UrlSymbolTarget,\n prop: string | symbol,\n receiver: any\n ): unknown {\n switch (prop) {\n case 'search':\n case 'searchParams':\n case 'url':\n case 'href':\n case 'toJSON':\n case 'toString':\n case 'origin':\n throw new StaticGenBailoutError(\n `Route ${target.pathname} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`nextUrl.${prop}\\`.`\n )\n case 'clone':\n return (\n target[urlCloneSymbol] ||\n (target[urlCloneSymbol] = () =>\n new Proxy(target.clone(), requireStaticNextUrlHandlers))\n )\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n}\n\nfunction createCacheComponentsError(route: string) {\n return new DynamicServerError(\n `Route ${route} couldn't be rendered statically because it used IO that was not cached. See more info here: https://nextjs.org/docs/messages/cache-components`\n )\n}\n\nfunction trackDynamic(\n store: WorkStore,\n workUnitStore: undefined | WorkUnitStore,\n expression: string\n): void {\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'private-cache':\n // TODO: Should we allow reading cookies and search params from the\n // request for private caches in route handlers?\n throw new Error(\n `Route ${store.route} used \"${expression}\" inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \"${expression}\" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n case 'unstable-cache':\n throw new Error(\n `Route ${store.route} used \"${expression}\" inside a function cached with \"unstable_cache(...)\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \"${expression}\" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'prerender':\n const error = new Error(\n `Route ${store.route} used ${expression} without first calling \\`await connection()\\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-request`\n )\n return abortAndThrowOnSynchronousRequestDataAccess(\n store.route,\n expression,\n error,\n workUnitStore\n )\n case 'prerender-client':\n throw new InvariantError(\n 'A client prerender store should not be used for a route handler.'\n )\n case 'prerender-runtime':\n throw new InvariantError(\n 'A runtime prerender store should not be used for a route handler.'\n )\n case 'prerender-ppr':\n return postponeWithTracking(\n store.route,\n expression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n if (process.env.NODE_ENV !== 'production') {\n // TODO: This is currently not really needed for route handlers, as it\n // only controls the ISR status that's shown for pages.\n workUnitStore.usedDynamic = true\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n"],"names":["RouteModule","createRequestStoreForAPI","createWorkStore","HTTP_METHODS","isHTTPMethod","getImplicitTags","patchFetch","getTracer","AppRouteRouteHandlersSpan","Log","autoImplementMethods","appendMutableCookies","HeadersAdapter","RequestCookiesAdapter","parsedUrlQueryToParams","printDebugThrownValueForProspectiveRender","serverHooks","DynamicServerError","workAsyncStorage","workUnitAsyncStorage","actionAsyncStorage","sharedModules","getIsPossibleServerAction","RequestCookies","cleanURL","StaticGenBailoutError","isStaticGenEnabled","abortAndThrowOnSynchronousRequestDataAccess","postponeWithTracking","createDynamicTrackingState","getFirstDynamicReason","ReflectAdapter","CacheSignal","scheduleImmediate","createServerParamsForRoute","getRedirectStatusCodeFromError","getURLFromRedirectError","isRedirectError","getAccessFallbackHTTPStatus","isHTTPAccessFallbackError","RedirectStatusCode","INFINITE_CACHE","executeRevalidates","trackPendingModules","InvariantError","createPrerenderResumeDataCache","WrappedNextRouterError","constructor","error","headers","AppRouteRouteModule","userland","definition","distDir","relativeProjectDir","resolvedPagePath","nextConfigOutput","methods","hasNonStaticMethods","dynamic","Error","pathname","process","env","NODE_ENV","lowercased","map","method","toLowerCase","toUpperCase","some","resolve","Response","status","do","handler","actionStore","workStore","requestStore","implicitTags","request","context","isStaticGeneration","cacheComponentsEnabled","renderOpts","cacheComponents","handlerContext","params","undefined","resolvePendingRevalidations","pendingWaitUntil","finally","NEXT_PRIVATE_DEBUG_CACHE","console","log","url","prerenderStore","res","userlandRevalidate","revalidate","defaultRevalidate","prospectiveController","AbortController","prospectiveRenderIsDynamic","cacheSignal","dynamicTracking","prerenderResumeDataCache","prospectiveRoutePrerenderStore","type","phase","rootParams","fallbackRouteParams","renderSignal","signal","controller","allowEmptyStaticShell","expire","stale","tags","renderResumeDataCache","hmrRefreshHash","captureOwnerStack","prospectiveResult","run","err","aborted","NEXT_DEBUG_BUILD","__NEXT_VERBOSE_LOGGING","route","then","cacheReady","dynamicReason","finalController","finalRoutePrerenderStore","responseHandled","Promise","reject","result","bodyHandled","arrayBuffer","body","statusText","abort","createCacheComponentsError","Headers","Location","mutableCookies","isAction","SeeOther","httpStatus","fetchMetrics","collectedTags","join","collectedRevalidate","collectedExpire","collectedStale","handle","req","staticGenerationContext","page","buildId","sharedContext","previouslyRevalidatedTags","fetchCache","isAppRoute","nextUrl","prerenderManifest","preview","response","dynamicUsageDescription","message","dynamicUsageStack","stack","forceDynamic","forceStatic","Proxy","forceStaticRequestHandlers","dynamicShouldError","requireStaticRequestHandlers","proxyNextRequest","tracer","setRootSpanAttribute","trace","runHandler","spanName","attributes","has","get","handlers","POST","PUT","DELETE","PATCH","OPTIONS","nextURLSymbol","Symbol","requestCloneSymbol","urlCloneSymbol","searchParamsSymbol","hrefSymbol","toStringSymbol","headersSymbol","cookiesSymbol","target","prop","receiver","seal","forceStaticNextUrlHandlers","href","clone","URLSearchParams","nextUrlHandlers","workUnitStore","getStore","trackDynamic","nextRequestHandlers","requireStaticNextUrlHandlers","store","expression","usedDynamic"],"mappings":"AASA,SACEA,WAAW,QAGN,kBAAiB;AACxB,SAASC,wBAAwB,QAAQ,oCAAmC;AAC5E,SACEC,eAAe,QAEV,iCAAgC;AACvC,SAA2BC,YAAY,EAAEC,YAAY,QAAQ,iBAAgB;AAC7E,SAASC,eAAe,QAA2B,0BAAyB;AAC5E,SAASC,UAAU,QAAQ,wBAAuB;AAClD,SAASC,SAAS,QAAQ,yBAAwB;AAClD,SAASC,yBAAyB,QAAQ,4BAA2B;AACrE,YAAYC,SAAS,4BAA2B;AAChD,SAASC,oBAAoB,QAAQ,mCAAkC;AACvE,SACEC,oBAAoB,QAEf,oDAAmD;AAC1D,SAASC,cAAc,Q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