I am developing a Firebase Cloud Function with TypeScript, debugging it locally using the Firebase Emulator Suite and WebStorm.
I noticed that sometimes, some changed are undetected by the debugger, hence somehow jumping over them when debugging, making the debugging obviously completely unreliable.
When deattaching the debugger, stopping Firebase Emulator Suite, recompiling the code with tsc, starting Firebase Emulator Suite and attaching the Debugger, the changes are debugged as expected.
I am certain this is not a code issue of mine. How is this caused and is there a way to resolve it?
Here's an example, which is not debugged after adding it:
allEvents = allEvents.filter(event => {
const timestampDate = event.timestamp.toDate();
const pastDay = subDays(new Date(), 1);
return timestampDate > pastDay;
});
Although there's breakpoints in all lines, the debugger simply jumps over it as can be seen:
The variables timestampDate and pastDay are shown to be undefined in the debugging variables section.
My tsconfig.json looks like this:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2019"
},
"compileOnSave": true,
"include": [
"src"
]
}