Variable Interpolation
Variables not being replaced
If{{variableName}} appears literally in your request instead of being substituted:
- Check your environment file — Variables must be defined in a
.envorhitspec.yamlfile. - Verify the environment is active — Use
hitspec run --env productionor select it in the UI. - Check for typos — Variable names are case-sensitive.
{{baseUrl}}and{{baseURL}}are different.
Circular variable references
If you get a “circular reference” error, check that your variables don’t reference each other:Captures & Dependencies
Capture value is empty
If a@capture directive isn’t extracting the expected value:
- Verify the JSONPath — Use
jsonpath $.data.idand ensure the response actually contains that path. - Check response content type — Captures only work on JSON responses for JSONPath expressions.
- Ensure the request succeeds — If the request returns an error status, the response body may not contain the expected structure.
Dependency order issues
Requests run top-to-bottom within a file. If request B depends on a capture from request A, make sure A comes first:SSL / TLS Errors
Certificate verification failed
If you seex509: certificate signed by unknown authority:
Self-signed certificates
For APIs using self-signed certificates, you can either disable verification or add the CA to your system trust store.Timeout Issues
Request timeout
If requests are timing out:The
--timeout flag (and HITSPEC_TIMEOUT) take a duration string like
30s, 1m, or 500ms. The timeout key in hitspec.yaml is an integer in
milliseconds (see below).hitspec.yaml:
Stress test timeout
During stress testing, individual request timeouts may need to be higher. Configure in your stress profile:hitspec serve & studio Issues
Port already in use
If you seelisten tcp :4000: bind: address already in use from hitspec serve --api-only:
WebSocket disconnects
The status bar shows “Disconnected” in red:- Check if the server is still running in your terminal.
- Check for proxy/firewall — Some corporate proxies block WebSocket connections.
- The client auto-reconnects with exponential backoff (1s to 30s). Wait a moment.
Files not appearing in sidebar
If your.http or .hitspec files don’t appear:
- Check the working directory —
hitspec studiouses the current directory by default. - Check file extensions — Only
.httpand.hitspecfiles are shown. - Nested directories — Files in subdirectories are shown in a tree structure. Expand the folder.
Assertion Failures
Unexpected assertion results
Common issues with assertions:Schema validation failures
If@assert body matchesSchema fails:
- Check the schema path — Relative paths are resolved from the file’s directory.
- Validate your schema — Ensure it’s valid JSON Schema (draft-07).
- Check for required fields — The response must include all
requiredfields.
CI/CD Issues
Exit codes
hitspec uses these exit codes:GitHub Actions fails but works locally
- Environment variables — Make sure all required variables are set in your CI environment.
- Network access — Ensure the CI runner can reach your API endpoints.
- Timeouts — CI runners may be slower; increase timeouts.
Performance
Slow test execution
- Enable parallel execution —
hitspec run --parallel tests/ - Reduce timeout for fast-failing —
hitspec run --timeout 5000 - Use
@if/@unlessto skip irrelevant tests conditionally.
Large response bodies
For endpoints returning large responses, assertions on the full body may be slow. Use specific JSONPath queries instead:Getting Help
If your issue isn’t listed here:- Run with
--verbosefor detailed output. - Check the GitHub Issues for known bugs.
- Open a new issue with your
.httpfile content, error message, and hitspec version (hitspec --version).