Skip to content

axios shim: response.status and response.data are undefined on live HTTPS GET #340

@proggeramlug

Description

@proggeramlug

What happened

await axios.get(<live URL>) resolves to a response object whose .status and .data are both undefined, instead of the actual HTTP status and body.

What you expected

status should be 200 (or whatever the upstream returns) and data should be the parsed/decoded body, matching node's axios behaviour.

Minimal reproduction

import axios from 'axios';

async function main(): Promise<void> {
  const r = await axios.get(
    'https://api.bsky.app/xrpc/app.bsky.feed.searchPosts?q=perry&limit=1',
    { timeout: 10000, validateStatus: () => true },
  );
  console.log('status:', r.status);
  console.log('data type:', typeof r.data);
  process.exit(0);
}
main().catch((e) => { console.log('err:', e); process.exit(1); });

Command:

perry compile repro.ts -o repro
./repro

Observed output:

status: undefined
data type: undefined

Expected: status: 200, data type: object (or string).

The same code under Node 20 + tsx returns the real response and 33 bookmarks for that endpoint.

Environment

  • Perry version: 0.5.395
  • Host OS: macOS 26.4 (arm64)
  • Target: native
  • Installed via: cargo (~/.cargo/bin/perry)

Diagnostic output

Compiles clean. When the listener's fetch loop hits await axios.get(…) later in the program, Perry prints [PERRY WARN] js_box_get: null box pointer #0 shortly before exiting — possibly a related downstream symptom in the await chain when the response object lacks expected fields.

Found while compiling skelpo-listener — the seven-channel fetch path runs to completion (no crash) but every channel returns 0 items because every HTTP response has undefined status/data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions