browser-process-hrtime icon indicating copy to clipboard operation
browser-process-hrtime copied to clipboard

fails to import in the browser because `process` is not defined

Open vilterp opened this issue 4 years ago • 1 comments
trafficstars

Hi, when I try to import this in my browser (building with esbuild) I immediately get an error because in the browser, process is not defined: https://github.com/kumavis/browser-process-hrtime/blob/38920d3d06ddecf0ad1b51f0f6872db946e3c035/index.js#L1

Shouldn't there be an if statement that checks for process being defined, so that this module can be used in the browser? I'm not sure how others have gotten this to work or what I'm missing. Thanks!

vilterp avatar Dec 01 '20 16:12 vilterp

try https://github.com/cabinjs/browser-hrtime

vltansky avatar Jan 24 '21 17:01 vltansky