Description
Version
v22.16.0
Platform
Microsoft Windows NT 10.0.19045.4291 x64
Subsystem
module
What steps will reproduce the bug?
// Repro steps (manual):
// 1. Create a basic project that installs @iconify/utils (or any package using "./*"
in exports).
// For example: npm install @iconify/utils
// 2. Then, create a basic Node.js script:
import '@iconify/utils';
console.log('Imported successfully');
// 3. Run the script with Node.js v22 on Windows:
// node index.js
// 4. You will see a DEP0155 deprecation warning like this:
// [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field...
How often does it reproduce? Is there a required condition?
Always, when using Node.js v22+ on Windows and importing packages that use "./*"
in their exports.
Does not occur on WSL or Unix systems, only on Windows.
What is the expected behavior? Why is that the expected behavior?
No deprecation warning should be shown, because the package does not use "./"
in its exports field — only "./*"
.
According to Node.js documentation, only "./"
mappings are deprecated (DEP0155). "./*"
is still supported and valid.
What do you see instead?
(node:12345) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at D:\Project\node_modules@iconify\utils\package.json imported from ...
Additional information
- This appears to be a false-positive warning triggered by Node.js on Windows only.
- Confirmed that the package (e.g., @iconify/utils) does not contain a
"./"
export — only"./*"
and subpaths like"./lib/colors"
. - The warning causes confusion for developers and affects build cleanliness in tools like Nuxt.
It would be great if Node could avoid triggering DEP0155 for "./*"
patterns, or clarify detection logic on Windows.