time-fix-plugin

raw JSON →
2.0.7 verified Sat Apr 25 auth: no javascript maintenance

Webpack plugin (v2.0.7, latest) that fixes the startTime for webpack watcher, addressing a watchpack issue where startTime is incorrectly set to 0, causing unnecessary recompilations. Maintained by egoist, supports webpack >=4.0.0. Differentiator: simple drop-in solution; for webpack <4, use v1. No active development since 2020.

error TypeError: TimeFixPlugin is not a constructor
cause Using const { TimeFixPlugin } = require('time-fix-plugin') – named import instead of default.
fix
Use const TimeFixPlugin = require('time-fix-plugin')
error Error: Cannot find module 'time-fix-plugin'
cause Package not installed or wrong version.
fix
Run npm install time-fix-plugin or check node_modules.
error Unhandled rejection: TypeError: Cannot read property 'startTime' of undefined
cause Using plugin with webpack <4 (startTime not present).
fix
Upgrade to webpack >=4 or use time-fix-plugin@1.
breaking Version 2 requires webpack >=4.0.0. Using with webpack <4 will cause errors or unexpected behavior.
fix Use version 1 (time-fix-plugin@1) for webpack <4.
deprecated No new releases since 2020; project is in maintenance mode. Consider alternatives if issues arise.
fix Monitor the GitHub repo for forks or alternatives.
gotcha Webpack v5 may have fixed the underlying watchpack issue; test if plugin is still needed.
fix Try removing the plugin and see if watcher behaves correctly.
npm install time-fix-plugin
yarn add time-fix-plugin
pnpm add time-fix-plugin

Add TimeFixPlugin to webpack plugins array to fix startTime for watcher.

// webpack.config.js
const TimeFixPlugin = require('time-fix-plugin');

module.exports = {
  // ... other config
  plugins: [
    new TimeFixPlugin()
  ]
};