teambit / bit

A build system for development of composable software.
https://bit.dev
Other
17.91k stars 930 forks source link

fix(import), do not remove the local env config in component.json #9319

Closed davidfirst closed 4 days ago

davidfirst commented 4 days ago

Currently, when the component.json of a component is written and the env is set to a local one, it gets removed upon bit import unexpectedly. After a long debugging, it turned out that the culprit was the aspect-merger. In order to remove multiple envs, it mutated the original ExtensionData of the scope component and deleted the env from there. This PR fixes it by cloning the entry before modifying it.

(for future reference - use Proxy to catch this issues, specifically the deleteProperty method of the Proxy).