### Describe the bug

https://github.com/developer-choi/axios-error-report

TypeError is occurred (in 1.6.6 version)

<img width="184" alt="image" src="https://github.com/axios/axios/assets/51902362/1f7f6e7f-8c8b-4ef7-9854-5c08f572d58b">

<img width="171" alt="image" src="https://github.com/axios/axios/assets/51902362/36042439-a071-485e-b696-9f2c01849759">

### To Reproduce

https://github.com/developer-choi/axios-error-report

### Code snippet

_No response_

### Expected behavior

_No response_

### Axios Version

1.6.6

### Adapter Version

_No response_

### Browser

CHROME

### Browser Version

120.0.6099.225

### Node.js Version

20.11.0

### OS

Window 11
test/unit/adapters/http.js
it('should properly handle synchronous errors inside the adapter', function () {
    return assert.rejects(() => axios.get('http://192.168.0.285'), /Invalid URL/);
  });
  it('should support function as paramsSerializer value', async () => {
    server = await startHTTPServer((req, res) => res.end(req.url));
    const {data} = await axios.post(LOCAL_SERVER_URL, 'test', {
      params: {
        x: 1
      },
      paramsSerializer: () => 'foo',
      maxRedirects: 0
    });
    assert.strictEqual(data, '/?foo');
  });
  describe('DNS', function() {
    it('should support a custom DNS lookup function', async function () {
      server = await startHTTPServer(SERVER_HANDLER_STREAM_ECHO);
      const payload = 'test';
      let isCalled = false;
      const {data} = await axios.post(`http://fake-name.axios:4444`, payload,{
        lookup: (hostname, opt, cb) =>  {
          isCalled = true;
          cb(null, '127.0.0.1', 4);
        }
      });
      assert.ok(isCalled);
      assert.strictEqual(data, payload);
    });
    it('should support a custom DNS lookup function with address entry passing', async function () {
      server = await startHTTPServer(SERVER_HANDLER_STREAM_ECHO);