Troubleshooting in VS Code with Mocha and hitting a breakpoint that halts at the 'read-only inlined content from source map' file

Yes, yes, I understand.

Current VS Code version is 1.25.1 Mocha version: 4.0.1

Mocha running through launch.json:

{
    "name": "mocha",
    "protocol": "inspector",
    "type": "node",
    "request": "launch",
    "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
    "stopOnEntry": false,
    "args": ["--no-timeouts", "--colors"], //you can specify paths to specific tests here
    "cwd": "${workspaceRoot}",
    "runtimeExecutable": null,
    "env": {
      "NODE_ENV": "testing"
    },
    "sourceMaps": true,
    "outFiles": [
        "${workspaceRoot}/dist"
    ],
  }

If you set a breakpoint in a file, it may open another tab with the same file title as "read-only inlined content from source map" and misaligned breakpoints. Also, if you try to edit the file, you realize it's not possible.

After trying out different solutions unsuccessfully, disabling sourceMap by setting it to false did the trick for me:

 "sourceMaps": false,

Note: The "outFiles" configuration did not have any effect and was part of my trial and error process, including attempting to build a map to /dist.

I'm unsure about what caused the change in my setup/configuration. I recently updated to vscode 1.25, but I cannot pinpoint the exact reason.

This answer contrasts the discussion on Breakpoints and debugging statements opening "read-only inlined content" available at this link.

Best of luck!

Answer №1

Here is a reposted answer:

To disable source maps in launch.json, change the value to false:

"sourceMaps": false,

This solution serves as the antithesis to the issue described in Breakpoints and debugging statements open "read-only inlined content"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering a ForbiddenError due to an invalid CSRF token when using multer in a locally integrated image upload router

As part of ensuring the security of my Express application, I have implemented csurf to protect against cross-site forgeries. I have globally registered it, as shown in the code below, and everything has been working smoothly so far. Recently, I decided t ...

Is there a way to remove the contents of a list along with the list itself? When removing a certain element x from list y, can we also delete y altogether if

I am managing two different collections, Classrooms Students Here is the schema for each: **CLASSROOM SCHEMA** const mongoose = require('mongoose'); const classroomSchema = new mongoose.Schema({ classroomname: { type: String }, cr ...

What is the best way to adjust the domain attribute in express-session according to the source of the request?

Utilizing express session, I have configured the domain to be domain: 'mydomain.com' in order for the session cookie to function across subdomains such as api.mydomain.com and staging.mydomain.com. However, this setup hinders the Set-Cookie head ...

Is it possible for a Node application to restart due to insufficient memory or CPU time?

My Node/Express application is hosted on a 512MB AWS LightSail instance with Nginx as the front-end. Most of the time, it operates smoothly. However, during the execution of apt-get update, there are instances when the web app becomes unresponsive and use ...

Is it possible to reach the maximum write capacity per second per database if I create a document using Promise.all in this manner?

I'm currently in the process of developing an app and I need to send a message to all my users' inboxes. The code I'm using in my cloud functions looks like this: const query = db.collection(`users`) .where("las ...

What are some tips for troubleshooting server-side issues in a MERN stack application?

Front-end code snippet: define('CreatePage', () => { const auth = useContext(AuthContext) const {request} = useHttp() const [content, setContent] = useState('') const [title, setTitle] = useState('') const [lead, setLead] = ...

The node-inspector window appears void of any content

After installing node-inspector using npm install -g nodeinspector, I encountered an issue where the dashboard appears blank except for a search bar. I have attempted to start the app, inspector, and browser in different orders, as well as reinstalled nod ...

"Exploring Angular UI-Router by conducting tests with the help of Mocha,

Experimenting with testing the following code in AngularJS using Mocha, Chai, and Sinon. $scope.send = function() { $state.transitionTo('module.sendhome'); }; Here is a test case for validation: it('send' , function () { scop ...

How to stop the previous page from reloading with Express.js routing?

Just starting out with express and web development in general, I have a question regarding routing. Currently, I am working on a web app using Firebase with pure JS and implementing routing on Firebase cloud functions. The routing logic is outlined below: ...

Ways to terminate a NodeJS child exec process?

I'm running a Python program from NodeJS using the exec function of child_process. I want to be able to terminate the process with a button click. Running this on Windows11. Below is my code snippet : var process__ = undefined; // declaring a global ...

The functionality of the Hubot script is restricted to Slack conversations where I initiate a direct message with the

At this very moment, my automated Hubot assistant is functioning properly. When I send the following message via direct message to the robot in Slack: qbot !npm bower The response provided by the robot contains a link: https://www.npmjs.com/package/bowe ...

MEAN Project - Organizational Endeavors

Can anyone share their recommended practices for developing a Single Web Page app project using the MEAN stack (MongoDB, Express, Angular and Node.js)? Our current setup involves: One repository for the Angular client-side code Another repository for th ...

Issue encountered while setting up NODE.JS dependencies

How can I resolve this issue? After running npm install --save, I encountered the following warning: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupp ...

The deletion process simply adds a question mark to the existing URL and does not actually remove the blogpost

I've been working on a small blog application using Node and Express. Strangely, when trying to delete a blog post, clicking the submit button adds a "?" into the link as shown here: http://prntscr.com/gizmvu After thoroughly reviewing my code, I&apo ...

Implementing slideDown() functionality to bootstrap 4 card-body with jQuery: A step-by-step guide

Here is the unique HTML code I created for the card section: <div class="row"> <% products.forEach(function(product){ %> <div class="col-lg-3 col-md-4"> <div class="card mb-4 shadow "> &l ...

Discover the troubleshooting steps for a Telegram bot within VS Code using Node.js

I am currently troubleshooting a code that utilizes the telegram bot-api in Node.js. Everything is running smoothly until it reaches this particular line: console.log('test') After printing "test", the code ceases to execute further. The strang ...

Do not include any null or empty objects when assigning to an array in Mongoose

When using mongoose's find() or findOne() methods, the returned value will be [] and null, respectively, if the where conditions are not met. This can cause issues when assigning these values to an array. Currently, I am filtering out the null values ...

Unlock the full potential of integrating external APIs with Next.js

As a newcomer to NextJs, I am facing the task of making calls to an external Python API from my frontend. Upon discovering NextJs's integrated API feature through creating folders in the app directory, namely api/resource/route, I am wondering what th ...

Populate PDF files using a Node.js API application deployed on the Azure cloud platform

Does anyone know a way to populate PDFs on a Node.js application without relying on a C or C++ library? I need to fill out PDFs stored on my server using data from a database. There are some solutions like https://www.npmjs.com/package/pdffiller and https: ...