component-detection icon indicating copy to clipboard operation
component-detection copied to clipboard

Yarn Detector issues

Open grvillic opened this issue 3 years ago • 1 comments

Problem

Parsing Yarn lock files fails when adding same package to dictionary, we should not break yarn detection as a whole but rather log the conflicting entry.

Error logs:

{"An item with the same key has already been added. Key: lodash@version"}

Error seems to be caused by this line:

https://github.com/microsoft/component-detection/blob/9fabc327880c4122f760a2554f7b1242f319f7b7/src/Microsoft.ComponentDetection.Detectors/yarn/YarnLockComponentDetector.cs#L72

Solution

Try adding to dictionary, if entry already exists, log warning and proceed.

grvillic avatar Feb 15 '22 17:02 grvillic

This is partially fixed in #77. Though further investigation or changes are required in our Yarn detector.

JamieMagee avatar Mar 16 '22 17:03 JamieMagee

I haven't heard any customer reports of this being an issue and we have already resolved the exception. Closing this unless something comes up.

cobya avatar Jan 19 '24 18:01 cobya