{"record":{"id":"1697364fe8be9a6b","repo":"microsoft/TypeScript","slug":"unknown-marker-markername-available-markers","errorCode":null,"errorMessage":"Unknown marker \"${markerName}\" Available markers: ${this.getMarkerNames().map(m => '\"' + m + '\"').join(\", \")}","messagePattern":"Unknown marker \"(.+?)\" Available markers: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/harness/fourslashImpl.ts","lineNumber":4475,"sourceCode":"                availableNames.push(fn);\r\n            }\r\n        });\r\n        return { file, availableNames };\r\n    }\r\n\r\n    private hasFile(name: string): boolean {\r\n        return this.tryFindFileWorker(name).file !== undefined;\r\n    }\r\n\r\n    private getLineColStringAtPosition(position: number, file: FourSlashFile = this.activeFile) {\r\n        const pos = this.languageServiceAdapterHost.positionToLineAndCharacter(file.fileName, position);\r\n        return `line ${(pos.line + 1)}, col ${pos.character}`;\r\n    }\r\n\r\n    public getMarkerByName(markerName: string): Marker {\r\n        const markerPos = this.testData.markerPositions.get(markerName);\r\n        if (markerPos === undefined) {\r\n            throw new Error(`Unknown marker \"${markerName}\" Available markers: ${this.getMarkerNames().map(m => '\"' + m + '\"').join(\", \")}`);\r\n        }\r\n        else {\r\n            return markerPos;\r\n        }\r\n    }\r\n\r\n    public setCancelled(numberOfCalls: number): void {\r\n        this.cancellationToken.setCancelled(numberOfCalls);\r\n    }\r\n\r\n    public resetCancelled(): void {\r\n        this.cancellationToken.resetCancelled();\r\n    }\r\n\r\n    public getEditsForFileRename({ oldPath, newPath, newFileContents, preferences }: FourSlashInterface.GetEditsForFileRenameOptions): void {\r\n        const test = (fileContents: { readonly [fileName: string]: string; }, description: string): void => {\r\n            const changes = this.languageService.getEditsForFileRename(oldPath, newPath, this.formatCodeSettings, preferences);\r\n            this.testNewFileContents(changes, fileContents, description);\r","sourceCodeStart":4457,"sourceCodeEnd":4493,"githubUrl":"https://github.com/microsoft/TypeScript/blob/b465fdbfe175304d9b977da137b2c178ae1091d3/src/harness/fourslashImpl.ts#L4457-L4493","documentation":"Thrown by getMarkerByName when the requested marker name is not present in testData.markerPositions. The message lists all available marker names (quoted, comma-separated) to help the author pick a valid one. Markers are declared in fourslash content with /*<markerName>*/ or object-marker syntax.","triggerScenarios":"Calling goTo.marker(\"myMarker\") / getMarkerByName(\"myMarker\") in a fourslash test that has no marker with that name. getMarkerNames() reflects only markers defined via the fourslash marker syntax during parseFileContent.","commonSituations":"Typo in the marker name, marker was removed during an edit, or the marker syntax is malformed so it was never registered. Also happens when copying a test that referenced markers without copying the marker definitions.","solutions":["Compare the requested name against the available markers listed in the error message.","Add the missing marker at the intended position using /*<myMarker>*/ in the test content.","Fix the typo or use the correct existing marker name."],"exampleFix":"// before — content has /*<start>*/ but test says\n// goTo.marker(\"begin\");\n// after\ngoTo.marker(\"start\");","handlingStrategy":"validation","validationCode":"function assertMarkerExists(state: FourSlashTestState, name: string) {\n    if (!state.getMarkerNames().includes(name)) {\n        throw new Error(`Marker '${name}' missing. Known: ${state.getMarkerNames().join(\", \")}`);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare each marker with /*<name>*/ at the exact caret target before referencing it.","Keep marker names short and unique to avoid duplicates that confuse lookups."],"tags":["fourslash","markers","name-mismatch"],"backgroundTag":null,"analyzedSha":"b465fdbfe175304d9b977da137b2c178ae1091d3","analyzedAt":"2026-08-12T05:38:42.698Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}