Vscode randomly opens hundreds of .js files draining the memory

5 days ago 9
ARTICLE AD BOX

I am using Nextjs latest 16.0.5, latest react, latest node. Every time I install an npm package my project starts to blatantly open .js files for no reason. It seems that it does not save when it installs, like if i have to save them manually. Example: npm install @xyflow/react --legacy-peer-deps (Not working) neither installing normally, opens like 150 js files. Example file: node_modules/d3-selection/src/selection/text.js

import React from 'react'; const Text = () => { return ( <div> </div> ); } export default Text; function textRemove() { this.textContent = ""; } function textConstant(value) { return function() { this.textContent = value; }; } function textFunction(value) { return function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; }; } export default function(value) { return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent; } A module cannot have multiple default exports. It returns this for almost every js file it touches
Read Entire Article