Mathieu Bourmaud
Mathieu Bourmaud

Reputation: 1

VSCode breakpoints no binding with TypeScript npm linked package

I have a Next.js app written using TypeScript with the following .tsconfig:

{
  "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"
  ]
}

Recently, we created a few private npm packages to share some code between apps, the .tsconfig looks like so:

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

When we work on the package, we simply use npm link <library-path> and we run tsc --watch inside the package we are working on. All this works well, the only issue is that when I try to debug, breakpoints doesn't bind. If I add a breakpoint inside the dist/*.js files, it works. I think it's related to sourcemaps, but I couldn't figure how.

If anyone has some ideas, I'd be happy to test them

Thanks

Mathieu

I tried various things that i've read online, new tsconfig params etc... Never worked.

Upvotes: 0

Views: 131

Answers (1)

jabbarhuang
jabbarhuang

Reputation: 1

download vscode 1.79.2 and install it.

Upvotes: 0

Related Questions