{"record":{"id":"f960569955d6a87d","repo":"hoppscotch/hoppscotch","slug":"pm-execution-setnextrequest-is-not-supported-in-f96056","errorCode":null,"errorMessage":"pm.execution.setNextRequest() is not supported in Hoppscotch (Collection Runner feature)","messagePattern":"pm\\.execution\\.setNextRequest\\(\\) is not supported in Hoppscotch \\(Collection Runner feature\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/hoppscotch-js-sandbox/src/bootstrap-code/pre-request.js","lineNumber":1615,"sourceCode":"          \"pm.iterationData.toJSON() is not supported in Hoppscotch (Collection Runner feature)\"\n        )\n      },\n    },\n\n    // Execution control (unsupported)\n    execution: {\n      location: (() => {\n        const location = [\"Hoppscotch\"]\n        Object.defineProperty(location, \"current\", {\n          value: \"Hoppscotch\",\n          writable: false,\n          enumerable: true,\n        })\n        Object.freeze(location)\n        return location\n      })(),\n      setNextRequest: () => {\n        throw new Error(\n          \"pm.execution.setNextRequest() is not supported in Hoppscotch (Collection Runner feature)\"\n        )\n      },\n      skipRequest: () => {\n        throw new Error(\n          \"pm.execution.skipRequest() is not supported in Hoppscotch (Collection Runner feature)\"\n        )\n      },\n      runRequest: () => {\n        throw new Error(\n          \"pm.execution.runRequest() is not supported in Hoppscotch (Collection Runner feature)\"\n        )\n      },\n    },\n\n    // Package imports (unsupported)\n    require: (packageName) => {\n      throw new Error(","sourceCodeStart":1597,"sourceCodeEnd":1633,"githubUrl":"https://github.com/hoppscotch/hoppscotch/blob/1acb8a3a7581e4db32ba0d529170c4669a2e1053/packages/hoppscotch-js-sandbox/src/bootstrap-code/pre-request.js#L1597-L1633","documentation":"`pm.execution.setNextRequest()` is a Postman Collection Runner control-flow method (override the next request to run). Hoppscotch does not support runner-driven flow control, so the stub at pre-request.js:1614 throws whenever invoked. Note `pm.execution.location` IS supported (it returns `[\"Hoppscotch\"]`), but the flow-control methods are not.","triggerScenarios":"Calling `pm.execution.setNextRequest(\"RequestName\")` or `pm.execution.setNextRequest(null)` in a script to reorder or stop a collection run.","commonSituations":"Postman collections that branch request order conditionally, or use `setNextRequest(null)` to terminate a run early. Scripts migrated from Postman that orchestrate flow.","solutions":["Remove the `setNextRequest(...)` call; Hoppscotch runs requests in the order defined by the client/runner, not the script.","Implement request ordering and early-exit logic in the external runner or UI driving Hoppscotch, not inside the sandbox script.","Use `pm.execution.location.current` (which IS supported) only to detect you are running under Hoppscotch, not to control flow."],"exampleFix":"// before\nif (skip) { pm.execution.setNextRequest(null) }\nelse { pm.execution.setNextRequest(\"GetUser\") }\n// after - flow control must live outside the script\n// (handle skip/order in the runner or UI; the script cannot reorder requests)","handlingStrategy":"validation","validationCode":"const UNSUPPORTED = /pm\\.execution\\.setNextRequest\\s*\\(/\nfunction assertNoFlowControl(src) {\n  if (UNSUPPORTED.test(src)) throw new Error(\"pm.execution.setNextRequest() is unsupported in Hoppscotch\")\n}","typeGuard":null,"tryCatchPattern":"try { /* run script */ }\ncatch (e) {\n  if (/execution\\.setNextRequest\\(\\) is not supported/.test(e?.message)) {\n    /* move ordering logic to the runner */\n  } else throw e\n}","preventionTips":["Do not encode request ordering inside scripts; configure it in the collection/runner.","Use pm.execution.location.current (supported) only to detect the Hoppscotch environment."],"tags":["hoppscotch","postman-compat","collection-runner","execution-control"],"backgroundTag":null,"analyzedSha":"1acb8a3a7581e4db32ba0d529170c4669a2e1053","analyzedAt":"2026-08-12T11:34:52.648Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}