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

Behavior of setting TZ inside .env changed in v12.2.5 #40233

Open
1 task done
JuanM04 opened this issue Sep 5, 2022 · 0 comments
Open
1 task done

Behavior of setting TZ inside .env changed in v12.2.5 #40233

JuanM04 opened this issue Sep 5, 2022 · 0 comments
Labels
bug Issue was opened via the bug report template.

Comments

@JuanM04
Copy link
Contributor

JuanM04 commented Sep 5, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

    Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Wed Aug 31 17:58:15 UTC 2022
    Binaries:
      Node: 16.17.0
      npm: 8.15.0
      Yarn: 1.22.19
      pnpm: 7.10.0
    Relevant packages:
      next: 12.2.5
      eslint-config-next: 12.2.5
      react: 18.2.0
      react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

This isn't a bug per se, but a breaking change for me going from v12.2.4 to v12.2.5 that I wanted to report.

Previously, I had inside my .env the line TZ=America/Argentina/Buenos_Aires that set the timezone for the entire application. After upgrading, I've found that the timezone is set a few moments after the initialization of the app (maybe introduced in #38483). This resulted in some packages initializing in one timezone and others in another, causing a mismatch.

Expected Behavior

I know that setting timezones inside a .env that then will be loaded is a bad idea, but this change could lead to other packages behaving weirdly because some env vars weren't set early enough.

Link to reproduction

.

To Reproduce

I tried to make a reproduction but I failed. This is such a niche situation that I couldn't figure out how to make a simple recreation.

If someone ends up here, I solved this by setting TZ outside the .env (like inside Vercel's Enviroment Variables or along the start script TZ=America/Argentina/Buenos_Aires next start).

@JuanM04 JuanM04 added the bug Issue was opened via the bug report template. label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant