Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why after update VSCode giving this error? Could not read source map for ... (Node.js)

My program was working before updating Visual Studio Code. After updating, Why am I get this error?

Could not read source map for file:///c:/Users/s.aytan/Desktop/node/new/Dashboard2/node_modules/fecha/lib/fecha.umd.js: ENOENT: no such file or directory, open 'c:\Users\s.aytan\Desktop\node\new\Dashboard2\node_modules\fecha\lib\fecha.umd.js.map'
like image 558
safa aytan Avatar asked Jul 13 '20 08:07

safa aytan


People also ask

Does Vscode support node js?

Visual Studio Code has support for the JavaScript and TypeScript languages out-of-the-box as well as Node. js debugging. However, to run a Node. js application, you will need to install the Node.

How do I run node js in Visual Studio?

In Visual Studio, go to Tools > Get Tools and Features. In the Visual Studio Installer, select the Node. js development workload, and select Modify to download and install the workload.

Is Visual Studio good for node js?

Visual Studio Code is the most popular free code editor among JavaScript developers around the world according to the State of JS 2020 survey. It is easily customizable and has a rich ecosystem of extensions to help your students learn Node. js and JavaScript.


3 Answers

Try to add this property to the .vscode\launch.json file:

"resolveSourceMapLocations": [
    "${workspaceFolder}/**",
    "!**/node_modules/**"
]

According to this issue, this should be configured as default in the next versions.

like image 72
baruchiro Avatar answered Oct 23 '22 21:10

baruchiro


Try installing an older version of VSCode, that solve this same issue here.

like image 28
Sebastian Juarez Avatar answered Sep 21 '22 21:09

Sebastian Juarez


you need to switch the launch type in .vscode\launch.json configuration from:

"type": "node",

to

"type": "pwa-node",
like image 2
Cédric Mallet Avatar answered Oct 23 '22 20:10

Cédric Mallet