Skip to content

"Cannot read properties of undefined (reading 'toLowerCase')" using pnpm and ignore #109

@marikaner

Description

@marikaner

I saw that there was a similar issue before, however this is closed and my issue persists with version 12.0.1.

When I use ignore in my configuration, I get the following error:

Cannot read properties of undefined (reading 'toLowerCase')

When I remove it, I don't really get an error, but an incorrect result:

undefined@
  NOT APPROVED
  Terms: Invalid license metadata
  Repository: None listed
  Homepage: None listed
  Author: None listed
  Contributors: None listed

I tried to debug into this a bit and found that the path of the dependency that causes this is something like that: ./node_modules/.pnpm/dependency@1.0.0. In the ./node_modules/.pnpm/dependency directory there is another node_modules directory and no package.json file. I believe that this is what causes this problem.

Now to my question(s):

  • Seeing the discussions on Cannot read properties of undefined (reading 'localeCompare') #101 and Move on from Arborist? #102 it seems to me that pnpm is not officially supported at the moment. Is that correct? If so, I think it would be nice to have this mentioned in the docs somewhere.
  • If not, is there a workaround or so? I could somehow check that this is the only result, but is it safe to assume that all dependencies were checked or is it possible that there are dependencies with wrong licenses that were skipped (e.g. by failing early)? Either way a mention in the docs would also be great. EDIT: I just checked with a more restrictive config, I still only get this one result, so it is not safe to assume that all dependencies were traversed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions