mhassan1 / yarn-plugin-licenses

Yarn Berry plugin that adds `yarn licenses` commands
39 stars 11 forks source link

Type Error: The "id" argument must be of type string. Received undefined #3

Closed Nikki1993 closed 3 years ago

Nikki1993 commented 3 years ago

Greetings,

There seems to be an error with plugin on latest yarn from master sources and Node 15, when running yarn licenses list it gives out this

❯ yarn licenses list
Type Error: The "id" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:278:15)
    at validateString (node:internal/validators:123:11)
    at Module.require (node:internal/modules/cjs/loader:990:3)
    at makePnPApi (/Users/nick/git/EB/client/.yarn/plugins/@yarnpkg/plugin-licenses.cjs:5:5525)
    at Module.getPackageManifest (/Users/nick/git/EB/client/.yarn/plugins/@yarnpkg/plugin-licenses.cjs:5:4981)
    at d (/Users/nick/git/EB/client/.yarn/plugins/@yarnpkg/plugin-licenses.cjs:5:1524)
    at P.execute (/Users/nick/git/EB/client/.yarn/plugins/@yarnpkg/plugin-licenses.cjs:5:3091)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async P.validateAndExecute (/Users/nick/git/EB/client/.yarn/releases/yarn-sources.cjs:2:654053)
    at async Y.run (/Users/nick/git/EB/client/.yarn/releases/yarn-sources.cjs:17:3854)

The only way I was able to reproduce it is when I downgraded a package pako from 2.x to 1.x but bringing it back up still causes the error above.

mhassan1 commented 3 years ago

Is this a duplicate of #4?

Nikki1993 commented 3 years ago

Don't think so. I am currently on latest yarn sources before the clipanion merge (so I am still on clipanion 2.0)

mhassan1 commented 3 years ago

This is caused by a breaking change in yarn master that will only be part of yarn 3: https://github.com/yarnpkg/berry/pull/2286

For now, stick with yarn 2.4.0.