Setting up remote debugging with ReactJS

I have remote ReactJs application that my visual studio connects to. I would like to perform remote debugging. But I am getting this error

We couldn’t find a corresponding source location, and didn’t find any source with the name layout.tsx

launch.json

{
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://10.36.182.124:3002",
            "webRoot": PATH TO MY PROJECT IN REMOTE MACHINE,
            "sourceMaps": true,
            "sourceMapPathOverrides": {
                "*": "${webRoot}/*"
            }
        }
    ]
}

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "sourceMap": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

Could not read source map for
file:///home/chris.zeng/ByteOverFlow/nextjs14-devoverflow/webpack%3A/_N_E/node_modules/next/dist/compiled/%40next/react-refresh-utils/dist/internal/helpers.js:
ENOENT: no such file or directory, open
‘/home/chris.zeng/ByteOverFlow/nextjs14-devoverflow/webpack:/_N_E/node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js.map’

find -name helpers.js.map
./nextjs14-devoverflow/node_modules/socks/build/common/helpers.js.map
./nextjs14-devoverflow/node_modules/domutils/lib/esm/helpers.js.map
./nextjs14-devoverflow/node_modules/domutils/lib/helpers.js.map
./nextjs14-devoverflow/node_modules/next/dist/esm/build/swc/helpers.js.map
./nextjs14-devoverflow/node_modules/next/dist/esm/build/webpack/config/helpers.js.map
./nextjs14-devoverflow/node_modules/next/dist/esm/build/templates/helpers.js.map ./nextjs14-devoverflow/node_modules/next/dist/build/swc/helpers.js.map
./nextjs14-devoverflow/node_modules/next/dist/build/webpack/config/helpers.js.map
./nextjs14-devoverflow/node_modules/next/dist/build/templates/helpers.js.map

Any help and advice is appreciated. Thanks.

Leave a Comment