-
Notifications
You must be signed in to change notification settings - Fork 730
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
DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field #1465
Comments
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours. Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy |
To not do a breaking change, could we expose a separate |
I am getting this on node v16.4.0 with |
same issue with other projects: postcss/postcss#1455, microsoft/playwright#6248, microsoft/tslib#135 (comment) |
My workaround was e. g.
|
@delvedor In Node.js nightly build v17.0.0-nightly20210923c7da13c7c4 (per nodejs/node#40121) this will be a runtime exception:
This change "fixes" that for me: --- node_modules/@elastic/elasticsearch/package.json.orig 2021-09-27 10:51:30.000000000 -0700
+++ node_modules/@elastic/elasticsearch/package.json 2021-09-27 10:51:36.000000000 -0700
@@ -75,7 +75,7 @@
"require": "./index.js",
"import": "./index.mjs"
},
- "./": "./"
+ "./*": "./*"
},
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
"keywords": [ |
a solution to this could be to list all the files explicitly |
Note that I've found a workaround for my use case. With https://github.com/elastic/apm-agent-nodejs/pull/2351/files#diff-4044438594f145ca4e5b9920e844237cce63dd56744a23e3f263456e6a9f7d35R37-R64 I'm avoiding using I don't know if others had use cases to directly import other parts of this package. |
Oh, exactly my use case. Thanks |
Closed in #1593. |
Node 16 logs a deprecation warning that the syntax for the
exports
declaration in the package.json changed from"./": "./"
to"./*": "./*"
.Node 12 doesn't support this new declaration and therefore this would be a breaking change.
How can we get rid of the deprecation warning for newer environments without breaking support for older versions?
The text was updated successfully, but these errors were encountered: