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

(node:21908) [DEP0128] DeprecationWarning: Invalid 'main' field in 'E:\Projects\vite-react-ts-starter\node_modules\react-icons\package.json' of 'lib'. Please either fix that or report it to the module author #461

Closed
callmeberzerker opened this issue Jul 23, 2021 · 5 comments

Comments

@callmeberzerker
Copy link

Describe the bug

No real need for additional info, I am pretty sure all people running latest node (15) and npm get this warning. Your main (most probably) needs to point to .cjs entry, and the module entry in package.json needs to point to esm version of it... at least according to this gist: https://gist.github.com/aelbore/65a4d2e86c3326f36607db111a7b6887

@JettScythe
Copy link

getting the same issue. Any idea when / if this will be fixed?

@U-4-E-A
Copy link

U-4-E-A commented Aug 20, 2021

I am currently unable to install with either yarn or npm, getting a timeout. Is that related to this issue?

@life-of-dan
Copy link

life-of-dan commented Sep 15, 2021

Following on from @callmeberzerker, to fix the warning change the following in the package.json file in the directory of react-icons

BEFORE

"license": "MIT",
  "main": "lib",
  "types": "./lib/esm/index.d.ts",

AFTER

"license": "MIT",
  "main": "./lib/cjs/index.js",
  "module": "./lib/esm/index.js",
  "exports": {
    ".": {
      "require":  "./lib/cjs/index.js",
      "default": "./lib/esm/index.js"
    }
  },
  "types": "./lib/esm/index.d.ts",

EDIT: This was a temporary fix, however caused another issue of exported modules not being exported from react-icon/all.js, if you guys know how to include them in the export properly it would fix this bug fully for the time being :)

@ImRodry
Copy link

ImRodry commented Jul 10, 2022

Any plans to fix this? I think this is quite an important issue

@kamijin-fanta
Copy link
Member

Discussed in #509

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

6 participants