{"record":{"id":"2e621f8495a3993b","repo":"microsoft/typescript-go","slug":"w-invalid-emitonly-value-d","errorCode":null,"errorMessage":"%w: invalid emitOnly value: %d","messagePattern":"%w: invalid emitOnly value: (.+?)","errorType":"validation","errorClass":"ErrClientError","httpStatus":null,"severity":"error","filePath":"internal/api/session.go","lineNumber":2627,"sourceCode":"\treturn program, compiler.EmitOptions{\n\t\tEmitOnly: emitOnly,\n\t}, nil\n}\n\nfunc (s *Session) getEmitProgram(snapshot SnapshotID, projectID ProjectID) (*compiler.Program, error) {\n\tsd, err := s.getSnapshotData(snapshot)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sd.getProgram(projectID)\n}\n\nfunc getEmitOnly(value *uint32) (compiler.EmitOnly, error) {\n\tif value == nil {\n\t\treturn compiler.EmitAll, nil\n\t}\n\tif *value > uint32(compiler.EmitOnlyDts) {\n\t\treturn compiler.EmitAll, fmt.Errorf(\"%w: invalid emitOnly value: %d\", ErrClientError, *value)\n\t}\n\temitOnly := compiler.EmitOnly(*value)\n\treturn emitOnly, nil\n}\n\nfunc emitProgram(ctx context.Context, program *compiler.Program, options compiler.EmitOptions) (*compiler.EmitResult, error) {\n\tresult := program.Emit(ctx, options)\n\tif result != nil {\n\t\treturn result, nil\n\t}\n\tif err := ctx.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn nil, errors.New(\"compiler emit returned nil result\")\n}\n\nfunc nonNilDiagnostics(diags []*ast.Diagnostic) []*DiagnosticResponse {\n\tresult := NewDiagnosticResponses(diags)","sourceCodeStart":2609,"sourceCodeEnd":2645,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/session.go#L2609-L2645","documentation":"Error \"%w: invalid emitOnly value: %d\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/api/session.go:2627 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}