Failure of VSCode breakpoints to function properly with TypeScript npm linked package

I am developing a Next.js app using TypeScript and my .tsconfig file includes the following configurations:

{
  "compilerOptions": {
    "baseUrl": "src",
    "experimentalDecorators": true,
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
  },
  "exclude": [
    "node_modules"
  ]
}

We recently developed private npm packages to share code across multiple apps, with a corresponding .tsconfig like this:

{
  "compilerOptions": {
    "esModuleInterop": true,
    "module": "commonjs",
    "target": "es2015",
    "declaration": true,
    "outDir": "./dist",
    "experimentalDecorators": true,
    "moduleResolution": "node",
  },
  "include": [
    "src/**/*.ts"
  ]
}

During development of the package, we utilize npm link <library-path> and run tsc --watch within the package being worked on. While everything seems to be functioning correctly, I encounter an issue where breakpoints do not bind when debugging. Setting breakpoints inside the dist/*.js files does work, leading me to believe it is related to sourcemaps, although I have not been able to pinpoint the exact problem.

If anyone has insights or suggestions to resolve this issue, I would greatly appreciate the assistance.

Thank you,

Mathieu

I have attempted various solutions found online and experimented with new tsconfig parameters, but so far, no success.

Answer №1

Get the latest version of Visual Studio Code (1.79.2) and proceed with the installation process.

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

Using ChartJS in React to style points as images

To create plots in React/NextJS, I am utilizing chartjs and react-chartjs-s. For a specific plot, I want to use an image as the pointStyle. In regular JavaScript, an image can be generated with const i = new Image() and then employed as the pointStyle in C ...

What is the proper way to structure a React component class without any props?

When working with Typescript in a React project, the top level component typically does not receive any props. What is the recommended approach for typing this scenario? I have been using the following coding structure as a template, but I am curious if t ...

Issue with Tailwind causing content to extend beyond screen with horizontal scrolling

I have a React-based NextJS application using Tailwind CSS. There is a page component that displays a list of individuals sorted from A to Ö (Swedish alphabet). In the mobile view, the user experience requires the list of alphabetical letters to be visibl ...

Exploring the integration of React Context API within a Next.js application to streamline the authentication process

I am looking to build a react app using Next.js. However, I am currently stuck and need assistance in figuring out how to proceed. I have implemented user authentication on the backend with node.js, passport.js, passport-local-mongoose, and express.sessi ...

Accessing email through GitHubProvider is not supported in next-auth

Currently, I am trying to integrate GitHub as a way of logging into my next.js application, but I am encountering the following error: Invalid `prisma.user.findUnique()` invocation: { where: { + email: String } } Argument `email` must not be null. ...

Guide on handling 404 page redirection within an axios service in Next.js

Currently, I am utilizing axios to handle my API calls. One thing that I want to achieve is checking the status of the response received from the api and potentially redirecting to a 404 page based on that. const api = axios.create({ headers: { commo ...

Cannot get object state to update using React hook

I'm not very experienced with React. I attempted to set the state as an object by fetching data from an API. The fetching process returns the correct object, but for some reason setting the state is not functioning correctly. const [info, setInfo] = ...

Having trouble making SCSS mixins work with CSS variables in NextJS?

My current next.config.js setup looks like this: module.exports = (phase, {defaultConfig}) => { if ('sassOptions' in defaultConfig) { defaultConfig['sassOptions'] = { includePaths: ['./styles'], ...

"Silently update the value of an Rxjs Observable without triggering notifications to subscribers

I'm currently working on updating an observable without alerting the subscribers to the next value change. In my project, I am utilizing Angular Reactive Forms and subscribing to the form control's value changes Observable in the following manner ...

Using a template reference variable as an @Input property for another component

Version 5.0.1 of Angular In one of my components I have the following template: <div #content>some content</div> <some-component [content]="content"></some-component> I am trying to pass the reference of the #content variable to ...

The custom validation in nestjs is throwing an error due to an undefined entity manager

I've been working on developing a custom validation for ensuring unique values in all tables, but I encountered this error: ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'getRepository') TypeError: Cannot read proper ...

What is the process for removing a package that was installed with npm link?

After using the command sudo npm link to install a node package in its directory, how can I properly uninstall the package once my development work is complete? By running npm link, the package gets installed as a symbolic link in the system's global ...

Is there an issue with my approach to using TypeScript generics in classes?

class Some<AttributeType = { bar: string }> { foo(attrs: AttributeType) { if (attrs.bar) { console.log(attrs.bar) } } } Unable to run TypeScript code due to a specific error message: Property 'bar' d ...

Expanding the global object in ES6 modules to include TypeScript support for extensions like `Autodesk.Viewing.Extension`

I created a custom forge extension and now I am looking to incorporate typescript support as outlined in this blog post. However, I am facing an issue where typescript cannot locate the objects like Autodesk.Viewing.Extension and Autodesk.Viewing.ToolInter ...

Is there a way to change the data type of all parameters in a function to a specific type?

I recently created a clamp function to restrict values within a specified range. (I'm sure most of you are familiar with what a clamp function does) Here is the function I came up with (using TS) function clamp(value: number, min: number, max: number ...

Is it advisable for a component to handle the states of its sub-components within the ngrx/store framework?

I am currently grappling with the best strategy for managing state in my application. Specifically, whether it makes sense for the parent component to handle the state for two subcomponents. For instance: <div> <subcomponent-one> *ngIf=&qu ...

NextJS believes that when extracting data from "FormData", it is considered as having a value of "null"

I'm currently working on a NextJS application and encountering an issue where the form data seems to be considered null by NextJS even before I pass it. Below is my action.ts file: 'use server'; import { date, z } from 'zod'; impo ...

IncredibleJs React UseEffect

import { useEffect } from 'react'; import WOW from 'wowjs/dist/wow.js'; import React from 'react'; import '@/assets/styles/scss/main.scss'; function MyApp({ Component, pageProps }) { useEffect(() => { ...

The attribute 'map' is not found on the data type 'Observable<[{}, {}]>'

Struggling to incorporate map, PublishReplay, and other rxjs functions into Angular6, I keep encountering a compilation error stating "Property 'map' does not exist on type 'Observable<[{}, {}]>'" every time. The same issue arises ...

Implementing the Infinite Scroll feature with 'react-infinite-scroll-component' on local JSON data: A step-by-step guide

Currently experimenting with frontEnd development, I have incorporated the 'react-infinite-scroll-component' as a dependency. My goal is to apply this effect to my local Json data without relying on any API calls at this stage. I'm encounter ...