{"record":{"id":"307948eb723e956c","repo":"karatelabs/karate","slug":"failed-to-hot-reload-step","errorCode":null,"errorMessage":"failed to hot reload step: {}","messagePattern":"failed to hot reload step: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/core/ScenarioRuntime.java","lineNumber":1862,"sourceCode":"        Resource resource = feature.getResource();\n        if (resource.getPath() == null) {\n            return false; // in-memory resource: nothing to reload from disk\n        }\n        Feature reloaded = Feature.read(Resource.from(resource.getPath()));\n        for (Step oldStep : steps) {\n            Step newStep = reloaded.findStepByLine(oldStep.getLine());\n            if (newStep == null) {\n                continue;\n            }\n            String oldText = canonicalStepText(oldStep);\n            String newText = canonicalStepText(newStep);\n            if (!oldText.equals(newText)) {\n                try {\n                    oldStep.parseAndUpdateFrom(newText);\n                    logger.info(\"hot reloaded line: {} - {}\", newStep.getLine(), newText);\n                    success = true;\n                } catch (Exception e) {\n                    logger.warn(\"failed to hot reload step: {}\", e.getMessage());\n                }\n            }\n        }\n        return success;\n    }\n\n    private static String canonicalStepText(Step step) {\n        String keyword = step.getKeyword();\n        String text = step.getText() == null ? \"\" : step.getText();\n        return keyword == null ? text : keyword + \" \" + text;\n    }\n\n    // ========== Debug Step Navigation ==========\n\n    /**\n     * Move execution back one step (for debugging).\n     * After calling this, the previous step will be re-executed.\n     */","sourceCodeStart":1844,"sourceCodeEnd":1880,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/ScenarioRuntime.java#L1844-L1880","documentation":"During dev-mode hot reload, Karate detects that an edited step's text changed and tries to re-parse the step in place. If `parseAndUpdateFrom` throws (invalid step syntax after the edit), this warning is logged and the reload for that step is skipped; the run continues with the old step.","triggerScenarios":"Editing a .feature file while a debug session is running and saving a step with broken Gherkin/step syntax so `Step.parseAndUpdateFrom(newText)` throws.","commonSituations":"Half-finished edits saved by autosave; malformed match expressions or JS in the edited line; mismatched triple-quotes or table rows.","solutions":["Fix the syntax of the edited step line and save again to trigger a fresh hot reload","Restart the debug session if the step remains stale","Validate the step text standalone (paste into a clean feature and run once)"],"exampleFix":"// before (broken step text saved during debug)\nAnd match response.foo == \n// after\nAnd match response.foo == '#string'","handlingStrategy":"fallback","validationCode":"// Mentally lint the edited line before saving during a debug session:\n// every match/eval expression must be complete and quoted","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Disable editor autosave during karate debug sessions","Save only syntactically complete steps","If a reload warning appears, fix and re-save; restart debug if stale"],"tags":["karate","hot-reload","debugging"],"backgroundTag":"invalid-argument-format","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}