UNPKG

63.6 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../../next-server/server/render.tsx"],"names":["noRouter","message","Error","ServerRouter","constructor","pathname","query","as","isFallback","isReady","basePath","locale","locales","defaultLocale","domainLocales","isPreview","isLocaleDomain","route","asPath","events","replace","push","reload","back","prefetch","beforePopState","enhanceComponents","options","App","Component","enhanceApp","enhanceComponent","renderDocument","Document","buildManifest","docComponentsRendered","props","docProps","buildId","canonicalBase","assetPrefix","runtimeConfig","nextExport","autoExport","dynamicImportsIds","dangerousAsPath","err","dev","ampPath","ampState","inAmpMode","hybridAmp","dynamicImports","headTags","gsp","gssp","customServer","gip","appGip","unstable_runtimeJS","unstable_JsPreload","devOnlyCacheBusterQueryString","scriptLoader","disableOptimizedLoading","__NEXT_DATA__","page","undefined","dynamicIds","length","serializeError","isDevelopment","invalidKeysMsg","methodName","invalidKeys","join","checkRedirectValues","redirect","req","method","destination","permanent","statusCode","errors","hasStatusCode","hasPermanent","allowedStatusCodes","has","destinationType","basePathType","url","renderToHTML","res","renderOpts","Date","now","Object","assign","pageConfig","fontManifest","reactLoadableManifest","ErrorDebug","getStaticProps","getStaticPaths","getServerSideProps","isDataReq","params","previewProps","getFontDefinition","callMiddleware","args","results","middlewareFunc","default","curResults","result","__nextFallback","__nextLocale","__nextDefaultLocale","isSSG","isBuildTimeSSG","defaultAppGetInitialProps","getInitialProps","origGetInitialProps","hasPageGetInitialProps","pageIsDynamic","isAutoExport","GSSP_COMPONENT_MEMBER_ERROR","SSG_GET_INITIAL_PROPS_CONFLICT","SERVER_PROPS_GET_INIT_PROPS_CONFLICT","SERVER_PROPS_SSG_CONFLICT","resolvedAsPath","isValidElementType","require","amp","endsWith","STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR","STATIC_STATUS_PAGES","includes","Loadable","preloadAll","previewData","routerIsReady","router","__nextIsLocaleDomain","ctx","AppTree","ampFirst","hasQuery","Boolean","hybrid","reactLoadableModules","head","AppContainer","children","updateHead","state","updateScripts","scripts","mountedInstances","Set","moduleName","__N_PREVIEW","STATIC_PROPS_ID","data","preview","staticPropsError","code","GSP_NO_RETURNED_VALUE","keys","filter","key","UNSTABLE_REVALIDATE_RENAME_ERROR","process","env","NODE_ENV","notFound","isNotFound","__N_REDIRECT","__N_REDIRECT_STATUS","__N_REDIRECT_BASE_PATH","isRedirect","revalidate","Number","isInteger","Math","ceil","console","warn","JSON","stringify","pageProps","pageData","SERVER_PROPS_ID","resolvedUrl","serverSidePropsError","GSSP_NO_RETURNED_VALUE","unstable_notFound","unstable_redirect","dataFetchError","error","filteredBuildManifest","pages","lowPriorityFiles","f","renderPage","html","EnhancedApp","EnhancedComponent","documentCtx","mod","manifestItem","add","id","files","forEach","item","__nextStrippedLocale","Array","from","nonRenderedComponents","expectedDocComponents","comp","plural","missingComponentList","map","e","ampRenderIndex","indexOf","AMP_RENDER_TARGET","substring","ampOptimizerConfig","ampSkipValidation","ampValidator","__NEXT_OPTIMIZE_FONTS","__NEXT_OPTIMIZE_IMAGES","optimizeFonts","optimizeImages","optimizeCss","Critters","cssOptimizer","ssrMode","reduceInlineStyles","path","distDir","publicPath","preload","fonts","errorToJSON","name","stack"],"mappings":"uEAEA,oDACA,wCACA,2CAEA,8CAUA,oEAEA,+BACA,8CACA,4CAMA,iCACA,+DACA,iEACA,wDACA,wEACA,oDAEA,yDACA,mCAYA,qCAKA,4DACA,uCAEA,wDACA,mEACA,8D,mFAOA,QAASA,CAAAA,QAAT,EAAoB,CAClB,KAAMC,CAAAA,OAAO,CACX,qJADF,CAEA,KAAM,IAAIC,CAAAA,KAAJ,CAAUD,OAAV,CAAN,CACD,CAED,KAAME,CAAAA,YAAmC,CAgBvCC,WAAW,CACTC,QADS,CAETC,KAFS,CAGTC,EAHS,CAIT,CAAEC,UAAF,CAJS,CAKTC,OALS,CAMTC,QANS,CAOTC,MAPS,CAQTC,OARS,CASTC,aATS,CAUTC,aAVS,CAWTC,SAXS,CAYTC,cAZS,CAaT,MA5BFC,KA4BE,aA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A,IAAI,CAACzL,OAAL,CAAa,aAAb,CAA4B,QAA5B,CAAP,CACD,CAED,MAAOyL,CAAAA,IAAP,CACD,CAED,QAAS0C,CAAAA,WAAT,CAAqBzM,GAArB,CAAwC,CACtC,KAAM,CAAE0M,IAAF,CAAQvP,OAAR,CAAiBwP,KAAjB,EAA2B3M,GAAjC,CACA,MAAO,CAAE0M,IAAF,CAAQvP,OAAR,CAAiBwP,KAAjB,CAAP,CACD,CAED,QAASpL,CAAAA,cAAT,CACEtB,GADF,CAEED,GAFF,CAGmC,CACjC,GAAIC,GAAJ,CAAS,CACP,MAAOwM,CAAAA,WAAW,CAACzM,GAAD,CAAlB,CACD,CAED,MAAO,CACL0M,IAAI,CAAE,wBADD,CAELvP,OAAO,CAAE,8BAFJ,CAGLgF,UAAU,CAAE,GAHP,CAAP,CAKD","sourcesContent":["import { IncomingMessage, ServerResponse } from 'http'\nimport { ParsedUrlQuery } from 'querystring'\nimport React from 'react'\nimport { renderToStaticMarkup, renderToString } from 'react-dom/server'\nimport { warn } from '../../build/output/log'\nimport { UnwrapPromise } from '../../lib/coalesced-function'\nimport {\n GSP_NO_RETURNED_VALUE,\n GSSP_COMPONENT_MEMBER_ERROR,\n GSSP_NO_RETURNED_VALUE,\n STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR,\n SERVER_PROPS_GET_INIT_PROPS_CONFLICT,\n SERVER_PROPS_SSG_CONFLICT,\n SSG_GET_INITIAL_PROPS_CONFLICT,\n UNSTABLE_REVALIDATE_RENAME_ERROR,\n} from '../../lib/constants'\nimport { isSerializableProps } from '../../lib/is-serializable-props'\nimport { GetServerSideProps, GetStaticProps, PreviewData } from '../../types'\nimport { isInAmpMode } from '../lib/amp'\nimport { AmpStateContext } from '../lib/amp-context'\nimport {\n AMP_RENDER_TARGET,\n SERVER_PROPS_ID,\n STATIC_PROPS_ID,\n STATIC_STATUS_PAGES,\n} from '../lib/constants'\nimport { defaultHead } from '../lib/head'\nimport { HeadManagerContext } from '../lib/head-manager-context'\nimport Loadable from '../lib/loadable'\nimport { LoadableContext } from '../lib/loadable-context'\nimport postProcess from '../lib/post-process'\nimport { RouterContext } from '../lib/router-context'\nimport { NextRouter } from '../lib/router/router'\nimport { isDynamicRoute } from '../lib/router/utils/is-dynamic'\nimport {\n AppType,\n ComponentsEnhancer,\n DocumentInitialProps,\n DocumentProps,\n DocumentType,\n getDisplayName,\n isResSent,\n loadGetInitialProps,\n NextComponentType,\n RenderPage,\n} from '../lib/utils'\nimport {\n tryGetPreviewData,\n NextApiRequestCookies,\n __ApiPreviewProps,\n} from './api-utils'\nimport { denormalizePagePath } from './denormalize-page-path'\nimport { FontManifest, getFontDefinitionFromManifest } from './font-utils'\nimport { LoadComponentsReturnType, ManifestItem } from './load-components'\nimport { normalizePagePath } from './normalize-page-path'\nimport optimizeAmp from './optimize-amp'\nimport {\n allowedStatusCodes,\n getRedirectStatus,\n Redirect,\n} from '../../lib/load-custom-routes'\nimport { DomainLocales } from './config'\n\nfunction noRouter() {\n const message =\n 'No router instance found. you should only use \"next/router\" inside the client side of your app. https://nextjs.org/docs/messages/no-router-instance'\n throw new Error(message)\n}\n\nclass ServerRouter implements NextRouter {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n events: any\n isFallback: boolean\n locale?: string\n isReady: boolean\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n isPreview: boolean\n isLocaleDomain: boolean\n\n constructor(\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n { isFallback }: { isFallback: boolean },\n isReady: boolean,\n basePath: string,\n locale?: string,\n locales?: string[],\n defaultLocale?: string,\n domainLocales?: DomainLocales,\n isPreview?: boolean,\n isLocaleDomain?: boolean\n ) {\n this.route = pathname.replace(/\\/$/, '') || '/'\n this.pathname = pathname\n this.query = query\n this.asPath = as\n this.isFallback = isFallback\n this.basePath = basePath\n this.locale = locale\n this.locales = locales\n this.defaultLocale = defaultLocale\n this.isReady = isReady\n this.domainLocales = domainLocales\n this.isPreview = !!isPreview\n this.isLocaleDomain = !!isLocaleDomain\n }\n\n push(): any {\n noRouter()\n }\n replace(): any {\n noRouter()\n }\n reload() {\n noRouter()\n }\n back() {\n noRouter()\n }\n prefetch(): any {\n noRouter()\n }\n beforePopState() {\n noRouter()\n }\n}\n\nfunction enhanceComponents(\n options: ComponentsEnhancer,\n App: AppType,\n Component: NextComponentType\n): {\n App: AppType\n Component: NextComponentType\n} {\n // For backwards compatibility\n if (typeof options === 'function') {\n return {\n App,\n Component: options(Component),\n }\n }\n\n return {\n App: options.enhanceApp ? options.enhanceApp(App) : App,\n Component: options.enhanceComponent\n ? options.enhanceComponent(Component)\n : Component,\n }\n}\n\nexport type RenderOptsPartial = {\n buildId: string\n canonicalBase: string\n runtimeConfig?: { [key: string]: any }\n assetPrefix?: string\n err?: Error | null\n nextExport?: boolean\n dev?: boolean\n ampPath?: string\n ErrorDebug?: React.ComponentType<{ error: Error }>\n ampValidator?: (html: string, pathname: string) => Promise<void>\n ampSkipValidation?: boolean\n ampOptimizerConfig?: { [key: string]: any }\n isDataReq?: boolean\n params?: ParsedUrlQuery\n previewProps: __ApiPreviewProps\n basePath: string\n unstable_runtimeJS?: false\n unstable_JsPreload?: false\n optimizeFonts: boolean\n fontManifest?: FontManifest\n optimizeImages: boolean\n optimizeCss: any\n devOnlyCacheBusterQueryString?: string\n resolvedUrl?: string\n resolvedAsPath?: string\n distDir?: string\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n disableOptimizedLoading?: boolean\n}\n\nexport type RenderOpts = LoadComponentsReturnType & RenderOptsPartial\n\nfunction renderDocument(\n Document: DocumentType,\n {\n buildManifest,\n docComponentsRendered,\n props,\n docProps,\n pathname,\n query,\n buildId,\n canonicalBase,\n assetPrefix,\n runtimeConfig,\n nextExport,\n autoExport,\n isFallback,\n dynamicImportsIds,\n dangerousAsPath,\n err,\n dev,\n ampPath,\n ampState,\n inAmpMode,\n hybridAmp,\n dynamicImports,\n headTags,\n gsp,\n gssp,\n customServer,\n gip,\n appGip,\n unstable_runtimeJS,\n unstable_JsPreload,\n devOnlyCacheBusterQueryString,\n scriptLoader,\n locale,\n locales,\n defaultLocale,\n domainLocales,\n isPreview,\n disableOptimizedLoading,\n }: RenderOpts & {\n props: any\n docComponentsRendered: DocumentProps['docComponentsRendered']\n docProps: DocumentInitialProps\n pathname: string\n query: ParsedUrlQuery\n dangerousAsPath: string\n ampState: any\n ampPath: string\n inAmpMode: boolean\n hybridAmp: boolean\n dynamicImportsIds: (string | number)[]\n dynamicImports: string[]\n headTags: any\n isFallback?: boolean\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n devOnlyCacheBusterQueryString: string\n scriptLoader: any\n isPreview?: boolean\n autoExport?: boolean\n }\n): string {\n return (\n '<!DOCTYPE html>' +\n renderToStaticMarkup(\n <AmpStateContext.Provider value={ampState}>\n {Document.renderDocument(Document, {\n __NEXT_DATA__: {\n props, // The result of getInitialProps\n page: pathname, // The rendered page\n query, // querystring parsed / passed by the user\n buildId, // buildId is used to facilitate caching of page bundles, we send it to the client so that pageloader knows where to load bundles\n assetPrefix: assetPrefix === '' ? undefined : assetPrefix, // send assetPrefix to the client side when configured, otherwise don't sent in the resulting HTML\n runtimeConfig, // runtimeConfig if provided, otherwise don't sent in the resulting HTML\n nextExport, // If this is a page exported by `next export`\n autoExport, // If this is an auto exported page\n isFallback,\n dynamicIds:\n dynamicImportsIds.length === 0 ? undefined : dynamicImportsIds,\n err: err ? serializeError(dev, err) : undefined, // Error if one happened, otherwise don't sent in the resulting HTML\n gsp, // whether the page is getStaticProps\n gssp, // whether the page is getServerSideProps\n customServer, // whether the user is using a custom server\n gip, // whether the page has getInitialProps\n appGip, // whether the _app has getInitialProps\n locale,\n locales,\n defaultLocale,\n domainLocales,\n isPreview,\n },\n buildManifest,\n docComponentsRendered,\n dangerousAsPath,\n canonicalBase,\n ampPath,\n inAmpMode,\n isDevelopment: !!dev,\n hybridAmp,\n dynamicImports,\n assetPrefix,\n headTags,\n unstable_runtimeJS,\n unstable_JsPreload,\n devOnlyCacheBusterQueryString,\n scriptLoader,\n locale,\n disableOptimizedLoading,\n ...docProps,\n })}\n </AmpStateContext.Provider>\n )\n )\n}\n\nconst invalidKeysMsg = (methodName: string, invalidKeys: string[]) => {\n return (\n `Additional keys were returned from \\`${methodName}\\`. Properties intended for your component must be nested under the \\`props\\` key, e.g.:` +\n `\\n\\n\\treturn { props: { title: 'My Title', content: '...' } }` +\n `\\n\\nKeys that need to be moved: ${invalidKeys.join(', ')}.` +\n `\\nRead more: https://nextjs.org/docs/messages/invalid-getstaticprops-value`\n )\n}\n\nfunction checkRedirectValues(\n redirect: Redirect,\n req: IncomingMessage,\n method: 'getStaticProps' | 'getServerSideProps'\n) {\n const { destination, permanent, statusCode, basePath } = redirect\n let errors: string[] = []\n\n const hasStatusCode = typeof statusCode !== 'undefined'\n const hasPermanent = typeof permanent !== 'undefined'\n\n if (hasPermanent && hasStatusCode) {\n errors.push(`\\`permanent\\` and \\`statusCode\\` can not both be provided`)\n } else if (hasPermanent && typeof permanent !== 'boolean') {\n errors.push(`\\`permanent\\` must be \\`true\\` or \\`false\\``)\n } else if (hasStatusCode && !allowedStatusCodes.has(statusCode!)) {\n errors.push(\n `\\`statusCode\\` must undefined or one of ${[...allowedStatusCodes].join(\n ', '\n )}`\n )\n }\n const destinationType = typeof destination\n\n if (destinationType !== 'string') {\n errors.push(\n `\\`destination\\` should be string but received ${destinationType}`\n )\n }\n\n const basePathType = typeof basePath\n\n if (basePathType !== 'undefined' && basePathType !== 'boolean') {\n errors.push(\n `\\`basePath\\` should be undefined or a false, received ${basePathType}`\n )\n }\n\n if (errors.length > 0) {\n throw new Error(\n `Invalid redirect object returned from ${method} for ${req.url}\\n` +\n errors.join(' and ') +\n '\\n' +\n `See more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp`\n )\n }\n}\n\nexport async function renderToHTML(\n req: IncomingMessage,\n res: ServerResponse,\n pathname: string,\n query: ParsedUrlQuery,\n renderOpts: RenderOpts\n): Promise<string | null> {\n // In dev we invalidate the cache by appending a timestamp to the resource URL.\n // This is a workaround to fix https://github.com/vercel/next.js/issues/5860\n // TODO: remove this workaround when https://bugs.webkit.org/show_bug.cgi?id=187726 is fixed.\n renderOpts.devOnlyCacheBusterQueryString = renderOpts.dev\n ? renderOpts.devOnlyCacheBusterQueryString || `?ts=${Date.now()}`\n : ''\n\n // don't modify original query object\n query = Object.assign({}, query)\n\n const {\n err,\n dev = false,\n ampPath = '',\n App,\n Document,\n pageConfig = {},\n Component,\n buildManifest,\n fontManifest,\n reactLoadableManifest,\n ErrorDebug,\n getStaticProps,\n getStaticPaths,\n getServerSideProps,\n isDataReq,\n params,\n previewProps,\n basePath,\n devOnlyCacheBusterQueryString,\n } = renderOpts\n\n const getFontDefinition = (url: string): string => {\n if (fontManifest) {\n return getFontDefinitionFromManifest(url, fontManifest)\n }\n return ''\n }\n\n const callMiddleware = async (method: string, args: any[], props = false) => {\n let results: any = props ? {} : []\n\n if ((Document as any)[`${method}Middleware`]) {\n let middlewareFunc = await (Document as any)[`${method}Middleware`]\n middlewareFunc = middlewareFunc.default || middlewareFunc\n\n const curResults = await middlewareFunc(...args)\n if (props) {\n for (const result of curResults) {\n results = {\n ...results,\n ...result,\n }\n }\n } else {\n results = curResults\n }\n }\n return results\n }\n\n const headTags = (...args: any) => callMiddleware('headTags', args)\n\n const isFallback = !!query.__nextFallback\n delete query.__nextFallback\n delete query.__nextLocale\n delete query.__nextDefaultLocale\n\n const isSSG = !!getStaticProps\n const isBuildTimeSSG = isSSG && renderOpts.nextExport\n const defaultAppGetInitialProps =\n App.getInitialProps === (App as any).origGetInitialProps\n\n const hasPageGetInitialProps = !!(Component as any).getInitialProps\n\n const pageIsDynamic = isDynamicRoute(pathname)\n\n const isAutoExport =\n !hasPageGetInitialProps &&\n defaultAppGetInitialProps &&\n !isSSG &&\n !getServerSideProps\n\n for (const methodName of [\n 'getStaticProps',\n 'getServerSideProps',\n 'getStaticPaths',\n ]) {\n if ((Component as any)[methodName]) {\n throw new Error(\n `page ${pathname} ${methodName} ${GSSP_COMPONENT_MEMBER_ERROR}`\n )\n }\n }\n\n if (hasPageGetInitialProps && isSSG) {\n throw new Error(SSG_GET_INITIAL_PROPS_CONFLICT + ` ${pathname}`)\n }\n\n if (hasPageGetInitialProps && getServerSideProps) {\n throw new Error(SERVER_PROPS_GET_INIT_PROPS_CONFLICT + ` ${pathname}`)\n }\n\n if (getServerSideProps && isSSG) {\n throw new Error(SERVER_PROPS_SSG_CONFLICT + ` ${pathname}`)\n }\n\n if (getStaticPaths && !pageIsDynamic) {\n throw new Error(\n `getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.` +\n `\\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`\n )\n }\n\n if (!!getStaticPaths && !isSSG) {\n throw new Error(\n `getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`\n )\n }\n\n if (isSSG && pageIsDynamic && !getStaticPaths) {\n throw new Error(\n `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +\n `\\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`\n )\n }\n\n let asPath: string = renderOpts.resolvedAsPath || (req.url as string)\n\n if (dev) {\n const { isValidElementType } = require('react-is')\n if (!isValidElementType(Component)) {\n throw new Error(\n `The default export is not a React Component in page: \"${pathname}\"`\n )\n }\n\n if (!isValidElementType(App)) {\n throw new Error(\n `The default export is not a React Component in page: \"/_app\"`\n )\n }\n\n if (!isValidElementType(Document)) {\n throw new Error(\n `The default export is not a React Component in page: \"/_document\"`\n )\n }\n\n if (isAutoExport || isFallback) {\n // remove query values except ones that will be set during export\n query = {\n ...(query.amp\n ? {\n amp: query.amp,\n }\n : {}),\n }\n asPath = `${pathname}${\n // ensure trailing slash is present for non-dynamic auto-export pages\n req.url!.endsWith('/') && pathname !== '/' && !pageIsDynamic ? '/' : ''\n }`\n req.url = pathname\n }\n\n if (pathname === '/404' && (hasPageGetInitialProps || getServerSideProps)) {\n throw new Error(\n `\\`pages/404\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n )\n }\n if (\n STATIC_STATUS_PAGES.includes(pathname) &&\n (hasPageGetInitialProps || getServerSideProps)\n ) {\n throw new Error(\n `\\`pages${pathname}\\` ${STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR}`\n )\n }\n }\n\n await Loadable.preloadAll() // Make sure all dynamic imports are loaded\n\n let isPreview\n let previewData: PreviewData\n\n if ((isSSG || getServerSideProps) && !isFallback) {\n // Reads of this are cached on the `req` object, so this should resolve\n // instantly. There's no need to pass this data down from a previous\n // invoke, where we'd have to consider server & serverless.\n previewData = tryGetPreviewData(req, res, previewProps)\n isPreview = previewData !== false\n }\n\n // url will always be set\n const routerIsReady = !!(getServerSideProps || hasPageGetInitialProps)\n const router = new ServerRouter(\n pathname,\n query,\n asPath,\n {\n isFallback: isFallback,\n },\n routerIsReady,\n basePath,\n renderOpts.locale,\n renderOpts.locales,\n renderOpts.defaultLocale,\n renderOpts.domainLocales,\n isPreview,\n (req as any).__nextIsLocaleDomain\n )\n const ctx = {\n err,\n req: isAutoExport ? undefined : req,\n res: isAutoExport ? undefined : res,\n pathname,\n query,\n asPath,\n locale: renderOpts.locale,\n locales: renderOpts.locales,\n defaultLocale: renderOpts.defaultLocale,\n AppTree: (props: any) => {\n return (\n <AppContainer>\n <App {...props} Component={Component} router={router} />\n </AppContainer>\n )\n },\n }\n let props: any\n\n const ampState = {\n ampFirst: pageConfig.amp === true,\n hasQuery: Boolean(query.amp),\n hybrid: pageConfig.amp === 'hybrid',\n }\n\n const inAmpMode = isInAmpMode(ampState)\n\n const reactLoadableModules: string[] = []\n\n let head: JSX.Element[] = defaultHead(inAmpMode)\n\n let scriptLoader: any = {}\n\n const AppContainer = ({ children }: any) => (\n <RouterContext.Provider value={router}>\n <AmpStateContext.Provider value={ampState}>\n <HeadManagerContext.Provider\n value={{\n updateHead: (state) => {\n head = state\n },\n updateScripts: (scripts) => {\n scriptLoader = scripts\n },\n scripts: {},\n mountedInstances: new Set(),\n }}\n >\n <LoadableContext.Provider\n value={(moduleName) => reactLoadableModules.push(moduleName)}\n >\n {children}\n </LoadableContext.Provider>\n </HeadManagerContext.Provider>\n </AmpStateContext.Provider>\n </RouterContext.Provider>\n )\n\n try {\n props = await loadGetInitialProps(App, {\n AppTree: ctx.AppTree,\n Component,\n router,\n ctx,\n })\n\n if ((isSSG || getServerSideProps) && isPreview) {\n props.__N_PREVIEW = true\n }\n\n if (isSSG) {\n props[STATIC_PROPS_ID] = true\n }\n\n if (isSSG && !isFallback) {\n let data: UnwrapPromise<ReturnType<GetStaticProps>>\n\n try {\n data = await getStaticProps!({\n ...(pageIsDynamic ? { params: query as ParsedUrlQuery } : undefined),\n ...(isPreview\n ? { preview: true, previewData: previewData }\n : undefined),\n locales: renderOpts.locales,\n locale: renderOpts.locale,\n defaultLocale: renderOpts.defaultLocale,\n })\n } catch (staticPropsError) {\n // remove not found error code to prevent triggering legacy\n // 404 rendering\n if (staticPropsError.code === 'ENOENT') {\n delete staticPropsError.code\n }\n throw staticPropsError\n }\n\n if (data == null) {\n throw new Error(GSP_NO_RETURNED_VALUE)\n }\n\n const invalidKeys = Object.keys(data).filter(\n (key) =>\n key !== 'revalidate' &&\n key !== 'props' &&\n key !== 'redirect' &&\n key !== 'notFound'\n )\n\n if (invalidKeys.includes('unstable_revalidate')) {\n throw new Error(UNSTABLE_REVALIDATE_RENAME_ERROR)\n }\n\n if (invalidKeys.length) {\n throw new Error(invalidKeysMsg('getStaticProps', invalidKeys))\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof (data as any).notFound !== 'undefined' &&\n typeof (data as any).redirect !== 'undefined'\n ) {\n throw new Error(\n `\\`redirect\\` and \\`notFound\\` can not both be returned from ${\n isSSG ? 'getStaticProps' : 'getServerSideProps'\n } at the same time. Page: ${pathname}\\nSee more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`\n )\n }\n }\n\n if ('notFound' in data && data.notFound) {\n if (pathname === '/404') {\n throw new Error(\n `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n )\n }\n\n ;(renderOpts as any).isNotFound = true\n }\n\n if (\n 'redirect' in data &&\n data.redirect &&\n typeof data.redirect === 'object'\n ) {\n checkRedirectValues(data.redirect as Redirect, req, 'getStaticProps')\n\n if (isBuildTimeSSG) {\n throw new Error(\n `\\`redirect\\` can not be returned from getStaticProps during prerendering (${req.url})\\n` +\n `See more info here: https://nextjs.org/docs/messages/gsp-redirect-during-prerender`\n )\n }\n\n ;(data as any).props = {\n __N_REDIRECT: data.redirect.destination,\n __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n }\n if (typeof data.redirect.basePath !== 'undefined') {\n ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n }\n ;(renderOpts as any).isRedirect = true\n }\n\n if (\n (dev || isBuildTimeSSG) &&\n !(renderOpts as any).isNotFound &&\n !isSerializableProps(pathname, 'getStaticProps', (data as any).props)\n ) {\n // this fn should throw an error instead of ever returning `false`\n throw new Error(\n 'invariant: getStaticProps did not return valid props. Please report this.'\n )\n }\n\n if ('revalidate' in data) {\n if (typeof data.revalidate === 'number') {\n if (!Number.isInteger(data.revalidate)) {\n throw new Error(\n `A page's revalidate option must be seconds expressed as a natural number for ${req.url}. Mixed numbers, such as '${data.revalidate}', cannot be used.` +\n `\\nTry changing the value to '${Math.ceil(\n data.revalidate\n )}' or using \\`Math.ceil()\\` if you're computing the value.`\n )\n } else if (data.revalidate <= 0) {\n throw new Error(\n `A page's revalidate option can not be less than or equal to zero for ${req.url}. A revalidate option of zero means to revalidate after _every_ request, and implies stale data cannot be tolerated.` +\n `\\n\\nTo never revalidate, you can set revalidate to \\`false\\` (only ran once at build-time).` +\n `\\nTo revalidate as soon as possible, you can set the value to \\`1\\`.`\n )\n } else if (data.revalidate > 31536000) {\n // if it's greater than a year for some reason error\n console.warn(\n `Warning: A page's revalidate option was set to more than a year for ${req.url}. This may have been done in error.` +\n `\\nTo only run getStaticProps at build-time and not revalidate at runtime, you can set \\`revalidate\\` to \\`false\\`!`\n )\n }\n } else if (data.revalidate === true) {\n // When enabled, revalidate after 1 second. This value is optimal for\n // the most up-to-date page possible, but without a 1-to-1\n // request-refresh ratio.\n data.revalidate = 1\n } else if (\n data.revalidate === false ||\n typeof data.revalidate === 'undefined'\n ) {\n // By default, we never revalidate.\n data.revalidate = false\n } else {\n throw new Error(\n `A page's revalidate option must be seconds expressed as a natural number. Mixed numbers and strings cannot be used. Received '${JSON.stringify(\n data.revalidate\n )}' for ${req.url}`\n )\n }\n } else {\n // By default, we never revalidate.\n ;(data as any).revalidate = false\n }\n\n // this must come after revalidate is attached\n if ((renderOpts as any).isNotFound) {\n return null\n }\n\n props.pageProps = Object.assign(\n {},\n props.pageProps,\n 'props' in data ? data.props : undefined\n )\n\n // pass up revalidate and props for export\n // TODO: change this to a different passing mechanism\n ;(renderOpts as any).revalidate =\n 'revalidate' in data ? data.revalidate : undefined\n ;(renderOpts as any).pageData = props\n }\n\n if (getServerSideProps) {\n props[SERVER_PROPS_ID] = true\n }\n\n if (getServerSideProps && !isFallback) {\n let data: UnwrapPromise<ReturnType<GetServerSideProps>>\n\n try {\n data = await getServerSideProps({\n req: req as IncomingMessage & {\n cookies: NextApiRequestCookies\n },\n res,\n query,\n resolvedUrl: renderOpts.resolvedUrl as string,\n ...(pageIsDynamic ? { params: params as ParsedUrlQuery } : undefined),\n ...(previewData !== false\n ? { preview: true, previewData: previewData }\n : undefined),\n locales: renderOpts.locales,\n locale: renderOpts.locale,\n defaultLocale: renderOpts.defaultLocale,\n })\n } catch (serverSidePropsError) {\n // remove not found error code to prevent triggering legacy\n // 404 rendering\n if (serverSidePropsError.code === 'ENOENT') {\n delete serverSidePropsError.code\n }\n throw serverSidePropsError\n }\n\n if (data == null) {\n throw new Error(GSSP_NO_RETURNED_VALUE)\n }\n\n const invalidKeys = Object.keys(data).filter(\n (key) => key !== 'props' && key !== 'redirect' && key !== 'notFound'\n )\n\n if ((data as any).unstable_notFound) {\n throw new Error(\n `unstable_notFound has been renamed to notFound, please update the field to continue. Page: ${pathname}`\n )\n }\n if ((data as any).unstable_redirect) {\n throw new Error(\n `unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${pathname}`\n )\n }\n\n if (invalidKeys.length) {\n throw new Error(invalidKeysMsg('getServerSideProps', invalidKeys))\n }\n\n if ('notFound' in data && data.notFound) {\n if (pathname === '/404') {\n throw new Error(\n `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n )\n }\n\n ;(renderOpts as any).isNotFound = true\n return null\n }\n\n if ('redirect' in data && typeof data.redirect === 'object') {\n checkRedirectValues(\n data.redirect as Redirect,\n req,\n 'getServerSideProps'\n )\n ;(data as any).props = {\n __N_REDIRECT: data.redirect.destination,\n __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n }\n if (typeof data.redirect.basePath !== 'undefined') {\n ;(data as any).props.__N_REDIRECT_BASE_PATH = data.redirect.basePath\n }\n ;(renderOpts as any).isRedirect = true\n }\n\n if (\n (dev || isBuildTimeSSG) &&\n !isSerializableProps(\n pathname,\n 'getServerSideProps',\n (data as any).props\n )\n ) {\n // this fn should throw an error instead of ever returning `false`\n throw new Error(\n 'invariant: getServerSideProps did not return valid props. Please report this.'\n )\n }\n\n props.pageProps = Object.assign({}, props.pageProps, (data as any).props)\n ;(renderOpts as any).pageData = props\n }\n } catch (dataFetchError) {\n if (isDataReq || !dev || !dataFetchError) throw dataFetchError\n ctx.err = dataFetchError\n renderOpts.err = dataFetchError\n console.error(dataFetchError)\n }\n\n if (\n !isSSG && // we only show this warning for legacy pages\n !getServerSideProps &&\n process.env.NODE_ENV !== 'production' &&\n Object.keys(props?.pageProps || {}).includes('url')\n ) {\n console.warn(\n `The prop \\`url\\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\\n` +\n `See more info here: https://nextjs.org/docs/messages/reserved-page-prop`\n )\n }\n\n // Avoid rendering page un-necessarily for getServerSideProps data request\n // and getServerSideProps/getStaticProps redirects\n if ((isDataReq && !isSSG) || (renderOpts as any).isRedirect) {\n return props\n }\n\n // We don't call getStaticProps or getServerSideProps while generating\n // the fallback so make sure to set pageProps to an empty object\n if (isFallback) {\n props.pageProps = {}\n }\n\n // the response might be finished on the getInitialProps call\n if (isResSent(res) && !isSSG) return null\n\n // we preload the buildManifest for auto-export dynamic pages\n // to speed up hydrating query values\n let filteredBuildManifest = buildManifest\n if (isAutoExport && pageIsDynamic) {\n const page = denormalizePagePath(normalizePagePath(pathname))\n // This code would be much cleaner using `immer` and directly pushing into\n // the result from `getPageFiles`, we could maybe consider that in the\n // future.\n if (page in filteredBuildManifest.pages) {\n filteredBuildManifest = {\n ...filteredBuildManifest,\n pages: {\n ...filteredBuildManifest.pages,\n [page]: [\n ...filteredBuildManifest.pages[page],\n ...filteredBuildManifest.lowPriorityFiles.filter((f) =>\n f.includes('_buildManifest')\n ),\n ],\n },\n lowPriorityFiles: filteredBuildManifest.lowPriorityFiles.filter(\n (f) => !f.includes('_buildManifest')\n ),\n }\n }\n }\n\n const renderPage: RenderPage = (\n options: ComponentsEnhancer = {}\n ): { html: string; head: any } => {\n if (ctx.err && ErrorDebug) {\n return { html: renderToString(<ErrorDebug error={ctx.err} />), head }\n }\n\n if (dev && (props.router || props.Component)) {\n throw new Error(\n `'router' and 'Component' can not be returned in getInitialProps from _app.js https://nextjs.org/docs/messages/cant-override-next-props`\n )\n }\n\n const {\n App: EnhancedApp,\n Component: EnhancedComponent,\n } = enhanceComponents(options, App, Component)\n\n const html = renderToString(\n <AppContainer>\n <EnhancedApp Component={EnhancedComponent} router={router} {...props} />\n </AppContainer>\n )\n\n return { html, head }\n }\n const documentCtx = { ...ctx, renderPage }\n const docProps: DocumentInitialProps = await loadGetInitialProps(\n Document,\n documentCtx\n )\n // the response might be finished on the getInitialProps call\n if (isResSent(res) && !isSSG) return null\n\n if (!docProps || typeof docProps.html !== 'string') {\n const message = `\"${getDisplayName(\n Document\n )}.getInitialProps()\" should resolve to an object with a \"html\" prop set with a valid html string`\n throw new Error(message)\n }\n\n const dynamicImportsIds = new Set<string | number>()\n const dynamicImports = new Set<string>()\n\n for (const mod of reactLoadableModules) {\n const manifestItem: ManifestItem = reactLoadableManifest[mod]\n\n if (manifestItem) {\n dynamicImportsIds.add(manifestItem.id)\n manifestItem.files.forEach((item) => {\n dynamicImports.add(item)\n })\n }\n }\n\n const hybridAmp = ampState.hybrid\n\n const docComponentsRendered: DocumentProps['docComponentsRendered'] = {}\n const nextExport =\n !isSSG && (renderOpts.nextExport || (dev && (isAutoExport || isFallback)))\n\n let html = renderDocument(Document, {\n ...renderOpts,\n canonicalBase:\n !renderOpts.ampPath && (req as any).__nextStrippedLocale\n ? `${renderOpts.canonicalBase || ''}/${renderOpts.locale}`\n : renderOpts.canonicalBase,\n docComponentsRendered,\n buildManifest: filteredBuildManifest,\n // Only enabled in production as development mode has features relying on HMR (style injection for example)\n unstable_runtimeJS:\n process.env.NODE_ENV === 'production'\n ? pageConfig.unstable_runtimeJS\n : undefined,\n unstable_JsPreload: pageConfig.unstable_JsPreload,\n dangerousAsPath: router.asPath,\n ampState,\n props,\n headTags: await headTags(documentCtx),\n isFallback,\n docProps,\n pathname,\n ampPath,\n query,\n inAmpMode,\n hybridAmp,\n dynamicImportsIds: Array.from(dynamicImportsIds),\n dynamicImports: Array.from(dynamicImports),\n gsp: !!getStaticProps ? true : undefined,\n gssp: !!getServerSideProps ? true : undefined,\n gip: hasPageGetInitialProps ? true : undefined,\n appGip: !defaultAppGetInitialProps ? true : undefined,\n devOnlyCacheBusterQueryString,\n scriptLoader,\n isPreview: isPreview === true ? true : undefined,\n autoExport: isAutoExport === true ? true : undefined,\n nextExport: nextExport === true ? true : undefined,\n })\n\n if (process.env.NODE_ENV !== 'production') {\n const nonRenderedComponents = []\n const expectedDocComponents = ['Main', 'Head', 'NextScript', 'Html']\n\n for (const comp of expectedDocComponents) {\n if (!(docComponentsRendered as any)[comp]) {\n nonRenderedComponents.push(comp)\n }\n }\n const plural = nonRenderedComponents.length !== 1 ? 's' : ''\n\n if (nonRenderedComponents.length) {\n const missingComponentList = nonRenderedComponents\n .map((e) => `<${e} />`)\n .join(', ')\n warn(\n `Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\\n` +\n `Missing component${plural}: ${missingComponentList}\\n` +\n 'Read how to fix here: https://nextjs.org/docs/messages/missing-document-component'\n )\n }\n }\n\n if (inAmpMode && html) {\n // inject HTML to AMP_RENDER_TARGET to allow rendering\n // directly to body in AMP mode\n const ampRenderIndex = html.indexOf(AMP_RENDER_TARGET)\n html =\n html.substring(0, ampRenderIndex) +\n `<!-- __NEXT_DATA__ -->${docProps.html}` +\n html.substring(ampRenderIndex + AMP_RENDER_TARGET.length)\n html = await optimizeAmp(html, renderOpts.ampOptimizerConfig)\n\n if (!renderOpts.ampSkipValidation && renderOpts.ampValidator) {\n await renderOpts.ampValidator(html, pathname)\n }\n }\n\n // Avoid postProcess if both flags are false\n if (process.env.__NEXT_OPTIMIZE_FONTS || process.env.__NEXT_OPTIMIZE_IMAGES) {\n html = await postProcess(\n html,\n { getFontDefinition },\n {\n optimizeFonts: renderOpts.optimizeFonts,\n optimizeImages: renderOpts.optimizeImages,\n }\n )\n }\n\n if (renderOpts.optimizeCss) {\n // eslint-disable-next-line import/no-extraneous-dependencies\n const Critters = require('critters')\n const cssOptimizer = new Critters({\n ssrMode: true,\n reduceInlineStyles: false,\n path: renderOpts.distDir,\n publicPath: '/_next/',\n preload: 'media',\n fonts: false,\n ...renderOpts.optimizeCss,\n })\n\n html = await cssOptimizer.process(html)\n }\n\n if (inAmpMode || hybridAmp) {\n // fix &amp being escaped for amphtml rel link\n html = html.replace(/&amp;amp=1/g, '&amp=1')\n }\n\n return html\n}\n\nfunction errorToJSON(err: Error): Error {\n const { name, message, stack } = err\n return { name, message, stack }\n}\n\nfunction serializeError(\n dev: boolean | undefined,\n err: Error\n): Error & { statusCode?: number } {\n if (dev) {\n return errorToJSON(err)\n }\n\n return {\n name: 'Internal Server Error.',\n message: '500 - Internal Server Error.',\n statusCode: 500,\n }\n}\n"]}
\No newline at end of file