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.