playwright: [BUG] Node.js 16 results in DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field with file import

Current exports syntax is not compatible with node 15.

(node:12200) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\zdm\.node_modules\playwright-chromium\package.json.
Update this package.json to use a subpath pattern like "./*".

You need to update to the new rules or remove this section.

New rules should looks like this:

"exports": {
    ".": {
      "import": "./index.mjs",
      "require": "./index.js"
    },
    "./*": "./*.js"
  },

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (13 by maintainers)

Commits related to this issue

Most upvoted comments

(node:6112) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping “./” in the “exports” field module resolution of the package at D:\Github Projects\emasbd\emasbd_frontend\node_modules\flowbite-vue\package.json imported from D:\Github Projects\emasbd\emasbd_frontend\node_modules. Mapping specifiers ending in “/” is no longer supported. (Use node --trace-deprecation ... to show where the warning was created)

(node:6112) [DEP0166] DeprecationWarning: Use of deprecated double slash resolving “./dist//index.mjs” for module request “.//index.mjs” matched to “./*” in the “exports” field module resolution of the package at D:\Github Projects\emasbd\emasbd_frontend\node_modules\flowbite-vue\package.json imported from D:\Github Projects\emasbd\emasbd_frontend\node_modules.

pls help me for getting this warning

In nodejs v17 current exports not working anymore.

[36e2ffe6dc] - (SEMVER-MAJOR) module: subpath folder mappings EOL (Guy Bedford) #40121 [64287e4d45] - (SEMVER-MAJOR) module: runtime deprecate trailing slash patterns (Guy Bedford) #40117

Could you pls add "./*": "./*" pattern.