From 3ba859a554c75f1245b6b9c5f47b54b68d740434 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 22 Apr 2022 15:21:39 +0200 Subject: [PATCH 1/3] update internal path import --- packages/next/server/base-server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/server/base-server.ts b/packages/next/server/base-server.ts index 4df12587419f..409f831f3269 100644 --- a/packages/next/server/base-server.ts +++ b/packages/next/server/base-server.ts @@ -18,7 +18,7 @@ import type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plug import type { BaseNextRequest, BaseNextResponse } from './base-http' import type { PayloadOptions } from './send-payload' -import { join, resolve } from 'path' +import path from '../shared/lib/isomorphic/path' import { parse as parseQs } from 'querystring' import { format as formatUrl, parse as parseUrl } from 'url' import { getRedirectStatus } from '../lib/load-custom-routes' @@ -66,6 +66,8 @@ import { PrerenderManifest } from '../build' import { ImageConfigComplete } from '../shared/lib/image-config' import { replaceBasePath } from './router-utils' +const { join, resolve } = path + export type FindComponentsResult = { components: LoadComponentsReturnType query: NextParsedUrlQuery From dc52366de59274cf0b9ad82062380acd521e1b23 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 22 Apr 2022 21:49:57 +0200 Subject: [PATCH 2/3] Simplify the App and Component handling in render --- packages/next/pages/_error.tsx | 17 ++--- packages/next/server/render.tsx | 114 ++++++++++++++++---------------- 2 files changed, 64 insertions(+), 67 deletions(-) diff --git a/packages/next/pages/_error.tsx b/packages/next/pages/_error.tsx index 0e2449dd1b13..6afa6e299ef2 100644 --- a/packages/next/pages/_error.tsx +++ b/packages/next/pages/_error.tsx @@ -41,16 +41,13 @@ export default class Error

extends React.Component

{ return (

- {/* TODO: remove this once RSC supports next/head */} - {!process.env.__NEXT_RSC && ( - - - {statusCode - ? `${statusCode}: ${title}` - : 'Application error: a client-side exception has occurred'} - - - )} + + + {statusCode + ? `${statusCode}: ${title}` + : 'Application error: a client-side exception has occurred'} + +