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

🐛 BUG: Logger timestamps ahead by 1 hour and 1 minute #3653

Open
1 task done
mundry opened this issue Aug 10, 2021 · 2 comments
Open
1 task done

🐛 BUG: Logger timestamps ahead by 1 hour and 1 minute #3653

mundry opened this issue Aug 10, 2021 · 2 comments

Comments

@mundry
Copy link

mundry commented Aug 10, 2021

Quick checklist

  • I am using the latest version of Snowpack and all plugins.

What package manager are you using?

yarn

What operating system are you using?

Linux

Describe the bug

When running snowpack the timestamps in the logger output are ahead by 1 hour and 1 minute compared to the current system time.

snowpack dev:

$ date && yarn start
Tue 10 Aug 15:21:33 CEST 2021
yarn run v1.22.10
$ snowpack dev
[16:22:33] [snowpack] Hint: run "snowpack init" to create a project config file. Using defaults...
[16:22:33] [snowpack] Ready!
[16:22:33] [snowpack] Server started in 53ms.
[16:22:33] [snowpack] Local: http://localhost:8080

snowpack build:

$ date && yarn build     
Tue 10 Aug 15:27:16 CEST 2021
yarn run v1.22.10
$ snowpack build
[16:28:16] [snowpack] Hint: run "snowpack init" to create a project config file. Using defaults...
[16:28:17] [snowpack] ! building files...
[16:28:17] [snowpack] ✔ files built. [0.03s]
[16:28:17] [snowpack] ! building dependencies...
[16:28:17] [snowpack] ✔ dependencies built. [0.00s]
[16:28:17] [snowpack] ! writing to disk...
[16:28:17] [snowpack] ✔ write complete. [0.02s]
[16:28:17] [snowpack] ▶ Build Complete!
Done in 0.60s.

The culprit seems to be the following line:
https://github.com/snowpackjs/snowpack/blob/7b8aba126cbddf711b1270ab05e1563111f4a699/snowpack/src/logger.ts#L62

I'm prepared to submit a PR to fix this.

Steps to reproduce

  1. mkdir snowpack-logger-timestamps
  2. cd snowpack-logger-timestamps
  3. npm init -y
  4. yarn add --dev snowpack
  5. Add start and build scripts to package.json
  6. Run date && yarn start
  7. Observe a difference of 1 hour and 1 minute in the output of date and the timestamp of snowpack's logging output.

Link to minimal reproducible example (optional)

No response

@joshgoebel
Copy link

Confirm, no idea why we're adding +1 to either hours or minutes.

@bentorkington
Copy link

@FredKSchott are you able to shed any light onto this change?

bentorkington added a commit to bentorkington/snowpack that referenced this issue Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants