diff --git a/packages/next/build/webpack/plugins/flight-manifest-plugin.ts b/packages/next/build/webpack/plugins/flight-manifest-plugin.ts index 50f0fda78e67..4982c6071db1 100644 --- a/packages/next/build/webpack/plugins/flight-manifest-plugin.ts +++ b/packages/next/build/webpack/plugins/flight-manifest-plugin.ts @@ -79,6 +79,12 @@ export class FlightManifestPlugin { id: string | number, mod: any ) { + // if appDir is enabled we shouldn't process chunks from + // the pages dir + if (chunk.name?.startsWith('pages/') && appDir) { + return + } + const isCSSModule = mod.type === 'css/mini-extract' || (mod.loaders && diff --git a/packages/react-dev-overlay/src/internal/ErrorBoundary.tsx b/packages/react-dev-overlay/src/internal/ErrorBoundary.tsx index b2a1a6f0a984..7f836313c510 100644 --- a/packages/react-dev-overlay/src/internal/ErrorBoundary.tsx +++ b/packages/react-dev-overlay/src/internal/ErrorBoundary.tsx @@ -12,6 +12,11 @@ class ErrorBoundary extends React.PureComponent< ErrorBoundaryState > { state = { error: null } + + static getDerivedStateFromError(error: Error) { + return { error } + } + componentDidCatch( error: Error, // Loosely typed because it depends on the React version and was