From 3e1cbf028652c555693dada7c59a2e39651556a2 Mon Sep 17 00:00:00 2001 From: Vedant Ravindra Dhoke <66007382+vedant713@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:57:57 -0400 Subject: [PATCH] fix(modules): prevent false DEP0155 warning for "./*" exports on Windows Ensure DEP0155 deprecation warning is only emitted for exact "./" export keys, not for "./*" or other subpath patterns. This avoids false positives when using valid pattern exports in package.json, aligning behavior with Node.js documentation. --- lib/internal/modules/esm/resolve.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index 859b6bfedac4bb..3ba707de8d5707 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -621,7 +621,7 @@ function packageExportsResolve( // throwInvalidSubpath(packageSubpath) // // To match "imports" and the spec. - if (StringPrototypeEndsWith(packageSubpath, '/')) { + if (key === './' && StringPrototypeEndsWith(packageSubpath, '/')) { emitTrailingSlashPatternDeprecation(packageSubpath, packageJSONUrl, base); }