vite-plugin-node-polyfills icon indicating copy to clipboard operation
vite-plugin-node-polyfills copied to clipboard

Bug: Missing process.hrtime polyfill in "process" polyfills

Open shyuuuuni opened this issue 9 months ago • 2 comments

Summary

I'm currently using vite-plugin-node-polyfills version 0.17.

After installing the plugin and enabling the process polyfill, most of the expected polyfills were successfully added — however, process.hrtime is missing.

I also tested this with the latest version (0.23), and the issue still persists.

Steps to Reproduce

  1. Install vite-plugin-node-polyfills (v0.17 or v0.23)

  2. Enable process polyfill

plugins: [
    nodePolyfills({
      include: ["process"],
    }),
]
  1. Use process.hrtime in App
 console.log("process:", process, process?.hrtime);
Image

Observe that process.hrtime is undefined

Expected Behavior

process.hrtime should be polyfilled along with other process properties.

Environment

  • Vite version: 5.4.14
  • Node version: 22
  • vite-plugin-node-polyfills version: 0.17 / 0.23
  • Browser: Chrome

shyuuuuni avatar Mar 31 '25 01:03 shyuuuuni

same issue

s2oy avatar Apr 11 '25 01:04 s2oy

I got "util.js:102 Uncaught ReferenceError: process is not defined", which seems eerily similar

RusteyBucket avatar Jul 19 '25 20:07 RusteyBucket