vite-plugin-node-polyfills
vite-plugin-node-polyfills copied to clipboard
Bug: Missing process.hrtime polyfill in "process" polyfills
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
-
Install vite-plugin-node-polyfills (v0.17 or v0.23)
-
Enable process polyfill
plugins: [
nodePolyfills({
include: ["process"],
}),
]
- Use
process.hrtimein App
console.log("process:", process, process?.hrtime);
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-polyfillsversion: 0.17 / 0.23- Browser:
Chrome
same issue
I got "util.js:102 Uncaught ReferenceError: process is not defined", which seems eerily similar