HubSpot / BuckyClient

Collect performance data from the client

Home Page:http://github.hubspot.com/bucky

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

time = process.hrtime() - throws Uncaught TypeError: process.hrtime is not a function

ishaikovsky opened this issue · comments

Followed simple instructions configuring the BuckyClient using Browserify and it keep failing on send with the

time = process.hrtime() - throws Uncaught TypeError: process.hrtime is not a function

message.

As I see - the browserify shim for the "process" module is really not including this method. So I assume there has to be some additional steps to get it up and running in browser?

The code you're referring to is not supposed to run on the client. My guess is your module loader works in a way this code didn't anticipate:

isServer = module? and not window?.module

Thanks, for the hint. I missed this condition and looked in the wrong direction. Let me try to investigate further.

Ok.. we needed to define window.module ourselves (exporting our main module at a global level).

In general it was not required by our app as everything was properly "export"'ed and "required" by browserify means. So we never defined any global window variables. However we did it now - so it will be validated properly by that check.

Hi, sorry to comment on an old thread, but I'm having the exact same problem, but I'm not sure how you managed to fix this @ishaikovsky. What was exactly what you exported to the global level ?
Thanks

By adding

window.module = module;

to my plugins initialization scripts. This made it understand that I'm using browserify and register in a proper way.

Great, thanks.
I'm new to using browserify so I'm still new to many of this; but thank you again