Skip to content

Bug: Missing process.hrtime polyfill in "process" polyfillsΒ #122

@shyuuuuni

Description

@shyuuuuni

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions