title: Interdependent includes in node.js result in a empty object
body: <p>I have two files that declare a class, both of them with <code>static</code> functions:</p>
  
  <p>foo.js:</p>
  
  <pre><code>const bar = require('./bar');
  
  console.log('bar in foo: ');
  console.log(bar);
  
  class foo {
    static _(test) {
      return 'foo_' + test + bar._(test);
    }
  
    static bar() {
      return 'bar';
    }
  }
  
  module.exports = foo;
  </code></pre>
  
  <p>bar.js:</p>
  
  <pre><code>const foo = require('./foo');
  
  console.log('foo in bar:');
  console.log(foo);
  
  class bar {
    static _(test) {
      return foo.bar(test);
    }
  }
  
  module.exports = bar;
  </code></pre>
  
  <p>In VS Code, code completion work in both files to get the other file's static method.</p>
  
  <p>But when I try to execute it:</p>
  
  <pre><code>const foo = require('./foo');
  foo._('test');
  </code></pre>
  
  <p>I can see that the recursive <code>require</code> don't work as I thought it would:</p>
  
  <pre><code>foo in bar:
  {}
  bar in foo:
  [Function: bar]
  bar.js:8
          return foo.bar(test);
                     ^
  
  TypeError: foo.bar is not a function
  </code></pre>
  
  <p>I know <code>class</code> in JS are syntaxic sugar around functions, but I am still surprised that the interpreter lose <code>static</code> members.</p>
  
  <p>Can anybody explain the working of require in that case? And why it result in a empty object?</p>