-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Node.js 16 results in DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field with file import #6026
Comments
Where do you see this message and this line? Could you provide the steps to reproduce? It does not complain on node/15.13 + npm/7.7.6 for me. |
try this code:
I need to add custom methods to the |
Works for me on the node / npm versions i mentioned above. Are there any steps I can follow to reproduce this? |
You need to perform require from the external script or package. |
That's what I did. Node changed its mind on the deprecation: nodejs/node#35747 What is your Node 15 version? Is it recent? |
here is the link to the specification, where this api marked as deprecated. |
my node - 5.13.0 |
sorry, 15.13.0 )) |
I'm on macOS, v15.13.0, I have a single dependency in my node_modules, which is playwright. My index file in the root folder is: require( "playwright/lib/client/page" ); and I can run it ok. If I add a non-default |
As https://nodejs.org/api/deprecations.html#deprecations_dep0148_folder_mappings_in_exports_trailing states,
Are you using playwright outside of the node_modules? |
adAhh, sorry. |
Yes, i installed playwright globally. |
Globally is still via node_modules, so we are good. Ok then, closing as not an issue! |
The issue is still present under node 15.13.0. Way to reproduce:
|
I also tried to reproduce, but was not successful in it. As far as I know its required to set the |
no, I haven't set
|
I think we need to just update exports to the new syntax. |
Try to set |
I tested, this not helped. |
Since global installs are discouraged, we are unlikely to address it before it becomes a real issue in Node. So far, this deprecation is reversed and I suspect it might vanish altogether because it is hard to change entire npm ecosystem at will. Let's see in what form it makes its way into LTS and revisit it. |
Hi,
(SEMVER-MAJOR) module: runtime deprecate subpath folder mappings (Antoine du Hamel) #37215 It's time to update. ) |
I was able to reproduce this, since there are no Node.js 16 docker images yet I had to manually install: docker run -it ubuntu:focal /bin/bash
curl -fsSL https://deb.nodesource.com/setup_16.x | bash
apt-get install -y nodejs
mkdir test
cd test
npm init -y
npm install playwright-chromium
cat > foo.js <<- EOM
const { Page } = require( "playwright-chromium/lib/client/page" );
EOM
node foo.js Which results as pointed out in:
|
Closing for now, nobody reported any issues. |
This was not fixed! |
See the comment in the pull request. A lot of package maintainers need to deal with it and the only option to have no warning is to break older node versions. We are waiting for more users to face into that problem. |
Did you tested with the old versions? |
See the GitHub Action run on the pull request. |
In nodejs v17 current exports not working anymore. [36e2ffe6dc] - (SEMVER-MAJOR) module: subpath folder mappings EOL (Guy Bedford) #40121 Could you pls add |
(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. (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 |
Current exports syntax is not compatible with node 15.
You need to update to the new rules or remove this section.
New rules should looks like this:
The text was updated successfully, but these errors were encountered: