Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"process.hrtime is not a function" in browser rollup 0.45.2 #1495

Closed
sijakret opened this issue Jul 20, 2017 · 1 comment
Closed

"process.hrtime is not a function" in browser rollup 0.45.2 #1495

sijakret opened this issue Jul 20, 2017 · 1 comment

Comments

@sijakret
Copy link

when i try to use rollup in the browser i get:

Uncaught (in promise) TypeError: process.hrtime is not a function
at timeStartHelper (rollup.browser.js:33)
at timeStart (rollup.browser.js:48)
at rollup (rollup.browser.js:10484)
...

after installing browser-process-hrtime and "shiming" process.hrtime something like the following it works

process.hrtime = require('browser-process-hrtime');
import { rollup } from 'rollup/dist/rollup.browser.js';

is this intentional or is some handling missing for the client/browser scenario?

@Rich-Harris
Copy link
Contributor

It sounds like process is being defined somewhere? Normally timeStartHelper uses window.performance.now in the browser, but it does that because process is normally undefined: https://github.com/rollup/rollup/blob/master/src/utils/flushTime.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants