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

Timestamp in verbose logs is incorrect by a factor of 1000x #3197

Closed
ryanwilsonperkin opened this issue Apr 8, 2022 · 1 comment · Fixed by #3198
Closed

Timestamp in verbose logs is incorrect by a factor of 1000x #3197

ryanwilsonperkin opened this issue Apr 8, 2022 · 1 comment · Fixed by #3198
Labels

Comments

@ryanwilsonperkin
Copy link
Contributor

Describe the bug

When running webpack build --watch with an infrastructure log level of debug, any time a file is changed a log line will be emitted that specifies which file changed and what the time was of the change. This time is incorrect because of a calculation on the initial timestamp, causing the real datetime Changed time is Fri Apr 8 2022 09:56:00 EST-0400 (Eastern Daylight Time) to be reported as Changed time is Mon Mar 26 54238 16:04:29 GMT-0400 (Eastern Daylight Time)

What is the current behavior?

Reports a datetime that is tens of thousands of years in the future 😄

To Reproduce

Here's a minimal reproduction: https://gist.github.com/ryanwilsonperkin/9b14fcc354e6c24df99c9985e1fa5ccd

Steps to reproduce the behavior:

  1. Set infrastructure logging level to debug
  2. Run a build in watch mode
  3. Modify one of the entry files to trigger a recompile
  4. Note that the modified datetime that is specified in the resulting log will be incorrect

Expected behavior

Expected the datetime to be accurate

Screenshots

image

Image alt text from terminal
~/src/github.com/ryanwilsonperkin/webpack-watch-timestamp-bug main*
❯ yarn webpack build --watch
yarn run v1.22.17
$ /Users/ryan/src/github.com/ryanwilsonperkin/webpack-watch-timestamp-bug/node_modules/.bin/webpack build --watch
    [webpack-cli] Compiler starting...
    [webpack-cli] Compiler is using config: '/Users/ryan/src/github.com/ryanwilsonperkin/webpack-watch-timestamp-bug/webpack.config.js'
asset main.js 1.2 KiB [compared for emit] (name: main)
./index.js 28 bytes [built] [code generated]
webpack 5.72.0 compiled successfully in 47 ms
    [webpack-cli] Compiler finished
    [webpack-cli] Compiler is watching files for updates...
    [webpack-cli] File '/Users/ryan/src/github.com/ryanwilsonperkin/webpack-watch-timestamp-bug/index.js' was modified
    [webpack-cli] Changed time is Mon Apr 02 54238 08:02:55 GMT-0400 (Eastern Daylight Time) (timestamp is 1649426673775)
    [webpack-cli] Compiler starting...
    [webpack-cli] Compiler is using config: '/Users/ryan/src/github.com/ryanwilsonperkin/webpack-watch-timestamp-bug/webpack.config.js'
assets by status 1.2 KiB [cached] 1 asset
./index.js 28 bytes [built]
webpack 5.72.0 compiled successfully in 9 ms
    [webpack-cli] Compiler finished
    [webpack-cli] Compiler is watching files for updates...


Please paste the results of npx webpack-cli info here, and mention other relevant information

  System:
    OS: macOS 12.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 81.55 MB / 16.00 GB
  Binaries:
    Node: 17.2.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.1.4 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 100.0.4896.75
    Firefox: 95.0.1
    Safari: 15.4
  Packages:
    webpack: ^5.72.0 => 5.72.0
    webpack-cli: ^4.9.2 => 4.9.2

Additional context

@rishabh3112
Copy link
Member

HI @ryanwilsonperkin,
Yeah, those dates are crazy 😄 .
Thanks for the Issue and Pull request.

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

Successfully merging a pull request may close this issue.

2 participants