Skip to content

Workaround for DEP0148: Use of deprecated folder mapping "./" in the "exports" field #38353

Open
@ai

Description

@ai

What steps will reproduce the bug?

npm i postcss
echo "let list = require('postcss/lib/list')" > index.js
node index.js

The output:

(node:12793) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/ai/test-cjs/node_modules/postcss/package.json.
Update this package.json to use a subpath pattern like "./*".

But replacing exports in PostCSS’s package.json to "./*": "./*.js" will break old Node.js.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

  1. Not show deprecation warning until we have active Node.js without * support.
  2. Suggest a solution to support both syntaxes.

Additional information

postcss/postcss#1561

The warning was disabled in Node.js 15.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecationsIssues and PRs related to deprecations.moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions