Couchbase module fails when gc-stats module in use


#1

When couchbase is used and gc-stats is used to obtain garbage collection statistics, the app fails with a TypeError: undefined is not a function.

Minimum index.js file to reproduce the failure case:

'use strict';

var express = require('express');
var gcs = new(require('gc-stats'))();
var couchbase = require('couchbase');
var cluster = new couchbase.Cluster();
var db = cluster.openBucket('default');

gcs.on('stats', function (info) {
  console.log("STATS", info);
});

var app = express();
app.use('/', function (req, res, next) {
  res.send("cmd done");
});
app.listen(8000);

Then npm install and run with node index.js.

Removing couchbase and gc-stats works fine and removing gc-stats and couchbase works fine.


#2

Filed CB support request 7993