#281·napajs

Error: ReferenceError: setTimeout is not defined

Author: frodoe7Created Feb 15, 2019Updated Feb 16, 2019

The issue occurs when calling zone.broadcastSync();

  • exactly here in my codes
zone.broadcastSync(() => {
      global.module = require('module');
});

and here inside napajs source code (zone-impl.js file)

ZoneImpl.prototype.broadcastSync = function (arg1, arg2) {
        var spec = this.createBroadcastRequest(arg1, arg2);
        var result = this._nativeZone.broadcastSync(spec);
        if (result.code !== 0) {
            throw new Error(result.errorMessage);
        }
    };

I tried to find a solution without opening a new issue - but it looks like this library does not have a big community so I hope to have a quick help