From f7eed07945375f0b4a76efcbb5cbfe87072c2261 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 18 Aug 2022 17:07:34 +0100 Subject: [PATCH] Use realpath when emitting traced package.json (#39683) This ensures we emit the real path when emitting traced package.json files so that we don't conflict with symlinked package paths. x-ref: slack thread Bug Related issues linked using fixes #number Integration tests added Errors have helpful link attached, see contributing.md --- .../next/build/webpack/plugins/next-trace-entrypoints-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts b/packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts index cd99b9d530c8..9d608d86ebbf 100644 --- a/packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts +++ b/packages/next/build/webpack/plugins/next-trace-entrypoints-plugin.ts @@ -563,7 +563,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance { const curPackageJsonPath = `${requestPath}/package.json` if (await job.isFile(curPackageJsonPath)) { await job.emitFile( - curPackageJsonPath, + await job.realpath(curPackageJsonPath), 'resolve', parent )