component-detection
component-detection copied to clipboard
Yarn Detector issues
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.
This is partially fixed in #77. Though further investigation or changes are required in our Yarn detector.
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.