Sonar-scanner (TypeScript): Cannot read property 'map' of undefined

SonarQube 7.9.2.30863
SonarQube Scanner 3.3.0.1492
Java 1.8.0_252 Oracle Corporation (64-bit)
Linux 4.19.123-coreos amd64
SonarJS 6.2.1

When running sonar-scanner, I’m seeing lots of these kinds of errors (names redacted):

ERROR: Failed to analyze file [scripts/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [scripts/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [scripts/.../foo.ts]: Cannot read property 'map' of undefined
INFO: 57/1447 files analyzed, current file: scripts/.../foo.ts
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined
INFO: 281/1447 files analyzed, current file: src/.../foo.ts
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined
ERROR: Failed to analyze file [src/.../foo.ts]: Cannot read property 'map' of undefined

I’m seeing this for about 50 files in our repo. All of them are TypeScript. I’m not exactly sure what more information you need to debug this, so please let me know.

Bump. Seems like a pretty obvious bug in the scanner.

I have the same issue after upgrading my angular project to version. My project uses typescript 4.0.2 now.
SonarScanner 4.4.0.2170
Java 1.8.0_202

Yeah, we’re also using the latest version of TypeScript. Seems like SonarJS doesn’t support it?

It doesnt. Logs state
You are using version of TypeScript 4.0.2 which is not officially supported; supported versions >=3.2.1 <3.8.0
Were you able to figure out a workaround?

No, I guess we’ll just have to wait for updates. I’ve run into issues with other tools (e.g. @typescript-eslint) that don’t support TypeScript 4 either.