Skip to content
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

Deprecation warning in Node 16 #152

Closed
magnihansen opened this issue Jul 14, 2021 · 6 comments
Closed

Deprecation warning in Node 16 #152

magnihansen opened this issue Jul 14, 2021 · 6 comments

Comments

@magnihansen
Copy link

When building my Angular 12 library application i'm getting a new deprecation warning after updating to Angular 12.

My warning message (local folders):
(node:9872) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\g\LogicmediaAngularNpm\logicmedia-angular\library-container-project\projects\logicmedia-angular\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./
".

I'm using [email protected] and Angular 12.1.1
I'm compiling my Angular library application using Ivy partial compilation mode.

🙁 Actual behavior
My library application builds and my npm package can be published but publishing with red lines is not intended.

🙂 Expected behavior
Angular not showing these red lines when building.

@orta orta changed the title Deprecation warning in Angular 12 Deprecation warning in Node 16 Aug 9, 2021
@orta
Copy link
Contributor

orta commented Aug 9, 2021

I just triggered this on a new build, it's confusing though:

: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\g\LogicmediaAngularNpm\logicmedia-angular\library-container-project\projects\logicmedia-angular\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./".

Use of deprecated folder mapping "./" in the "exports" field... Update this package.json to use a subpath pattern like "./"

@csvn
Copy link

csvn commented Aug 13, 2021

My error message looks slightly different:

DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of 
the package at C:\...\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./*".

According to Node docs, it should just be replacing ./ with ./*.

    "exports": {
        ".": {
            "module": "./tslib.es6.js",
            "import": "./modules/index.js",
            "default": "./tslib.js"
        },
-       "./": "./"
+      "./*: "./*"
    }

Though I can't see the reason to export everything in the root. Mostly since there are pretty much no Javascript files to import. The only thing that might need to be exported as far as I know is package.json.

-       "./": "./"
+      "./package.json: "./package.json"

@yonnic
Copy link

yonnic commented Sep 8, 2021

i have the same issue on a svelte project because of some deep dependency. Would be good to have this warning gone

@LittleBigBug
Copy link

This is a duplicate of #134. Would be nice to see fixed

@bmaland-visma
Copy link

tslib now breaks in node 17:

Error loading `tslib` helper library.                                           
[!] Error: Package subpath './package.json' is not defined by "exports" in .../tslib/package.json

@jakebailey
Copy link
Member

Dupe of #134, fixed back in tslib 2.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants