You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
panic: nil pointer dereference in CreateDiagnosticForNodeInSourceFile for a malformed "files" array in tsconfig.json #65079
error TS18002: The 'files' list in config file '<dir>/tsconfig.json' is empty.
tsconfig.json(1,1): error TS5092: The root value of a 'tsconfig.json' file must be an object.
tsconfig.json(1,11): error TS1137: Expression or comma expected.
tsconfig.json(1,12): error TS1012: Unexpected token.
Additional information about the issue
In the "files list is empty" branch (tsconfigparsing.go:1190-1200), ForEachTsConfigPropArray(sourceFile.SourceFile, "files", ...) returns nil for this malformed JSON, and CreateDiagnosticForNodeInSourceFile dereferences the nil node (errors.go:93). TypeScript 6.0.3 calls createDiagnosticForNodeInSourceFileOrCompilerDiagnostic at this spot, which falls back to a global diagnostic; that's why its TS18002 has no location. The Go equivalent, CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic, already exists (errors.go:90), so the fix is probably to call it here.
Activity