Visual Studio Code hitting invisible breakpoints in compiled .Next files

Viewed 16

I'm fairly new to NextJS but I'm seeing something that's distrupting my workflow.

I've set up my launch.json as per https://nextjs.org/docs/advanced-features/debugging#using-the-debugger-in-visual-studio-code

When I run my application from the selected launch config I am able to hit the breakpoints I expect within my TypeScript files no problem, but every time I start my application I notice VSC is hitting breakpoints that don't exist within files in the /.Next folder. As you can see from the screenshot, it thinks this is a breakpoint in my authProvider.tsx file.

Can anyone explain why this might be, and how I stop it from happening?

enter image description here

Here's my tsconfig.json:


{
  "compilerOptions": {
    "target": "es2017",
    "module": "commonjs",
    "sourceMap": true,
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */// "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
    "esModuleInterop": true,
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "include": [
    "src/**/*.ts"
    /* Include every ts file in source folder */
  ],
  "exclude": [
    "node_modules"
    /* exclude everything in  node_modules */
  ]
}

And my launch config is an exact copy of what is shown on the link above.

0 Answers
Related