Instantiation of `Agent` without parameter caused an error

  • Version: found at v7.10.0
  • Platform: 64-bit Windows 10/7
  • Subsystem: https

When I run the code below, it causes an error: Type Error: Cannot read property 'maxCachedSessions' of undefined.

new require('https').Agent();

According to document, The parameter options of new Agent is not required. So I think the error should not be raised.

reference
An Agent object for HTTPS similar to http.Agent. See https.request() for more information. (Class: https.Agent)
new Agent([options]) (new Agent([options]))