Skip to content

Intl.DateTimeFormat().resolvedOptions().timeZone undefined on MacOS 14.0 (Sonoma) #50301

Description

@khawarizmus

Version

v18.18.2

Platform

Darwin MacBook-Pro.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:42 PDT 2023; root:xnu-10002.1.13~1/RELEASE_X86_64 x86_64

Subsystem

Intl.DateTimeFormat().resolvedOptions().timeZone

What steps will reproduce the bug?

Executing the following code would yield undefined

new Intl.DateTimeFormat().resolvedOptions().timeZone // undefined

How often does it reproduce? Is there a required condition?

As long as it's on MacOS 14.0 (Sonoma) it will always return undefined

What is the expected behavior? Why is that the expected behavior?

I expect to get back a properly resolved timezone. as that's how Intl is supposed to work

What do you see instead?

I get an undefined

Additional information

This is currently a known bug that chrome was facing as well since MacOS 14.0 (Sonoma) changed the way to resolve Timezones as you can see here js-temporal/temporal-polyfill#264 (comment)

Activity

  1. targos commented on Oct 20, 2023

    @targos
    Member

    Can't reproduce. Am I missing something?

    $ sw_vers
    ProductName:		macOS
    ProductVersion:		14.0
    BuildVersion:		23A344
    
    $ node
    Welcome to Node.js v18.18.2.
    Type ".help" for more information.
    > new Intl.DateTimeFormat().resolvedOptions().timeZone // undefined
    'CET'
    
  2. bnoordhuis commented on Oct 20, 2023

    @bnoordhuis
    Member

    @gimyboya what does echo $TZ print on your system?

    You can probably work around the issue by setting TZ to some known-good value, for example:

    $ env TZ=Europe/Amsterdam node app.js
    
  3. targos commented on Oct 20, 2023

    @targos
    Member

    @bnoordhuis TZ is not set in my environment.

  4. targos commented on Oct 20, 2023

    @targos
    Member

    From looking at the V8 issue, it seems related to the ICU version. @gimyboya how did you install Node.js on your machine?
    The official binaries are statically linked to ICU 73. Maybe your version is not?

  5. khawarizmus commented on Oct 21, 2023

    @khawarizmus
    Author

    From looking at the V8 issue, it seems related to the ICU version. @gimyboya how did you install Node.js on your machine? The official binaries are statically linked to ICU 73. Maybe your version is not?

    @targos I am using nvm 0.39.1 to install different node versions. and TZ is not set in my environment.

  6. DavidDudson commented on Oct 22, 2023

    @DavidDudson

    We are also getting this. 18.18.2 returns undefined, 18.16.0 returns the correct value. using nvm aswell.

  7. DavidDudson commented on Oct 22, 2023

    @DavidDudson
    Screenshot 2023-10-23 at 9 47 17 am Screenshot 2023-10-23 at 9 47 11 am Screenshot 2023-10-23 at 9 47 07 am Screenshot 2023-10-23 at 9 47 00 am Screenshot 2023-10-23 at 9 49 56 am
  8. DavidDudson commented on Oct 22, 2023

    @DavidDudson

    It looks like the fix is actually in ICU 74.

  9. added
    macosIssues and PRs related to the macOS platform.
    icuIssues and PRs related to the ICU dependency.
    on Oct 23, 2023
  10. dburles commented on Oct 23, 2023

    @dburles

    I'm pretty certain this affects Node >= 18.18.2

  11. MrJithil commented on Oct 23, 2023

    @MrJithil
    Member

    So, should we wait for the ICU next release? Or patch it to Node >= 18.18.2 ?

    Please let me know, I can work on it.

  12. targos commented on Oct 23, 2023

    @targos
    Member

    @srl295 What do you think? Are we close to the ICU 74 release? Should we cherry-pick the fix in the mean time?

  13. richardlau commented on Oct 23, 2023

    @richardlau
    Member
  14. srl295 commented on Oct 23, 2023

    @srl295
    Member

    @targos been trying to ping you folks. 74 is in RC and I already landed a fix to it that had broken the node build. So I'd wait at this point

  15. srl295 commented on Oct 23, 2023

    @srl295
    Member

    @targos been trying to ping you folks. 74 is in RC and I already landed a fix to it that had broken the node build. So I'd wait at this point

    unicode-org/icu#2664 is the pr that un breaks the nodejs build.

  16. srl295 commented on Oct 23, 2023

    @srl295
    Member

    If you are going to want this in a prior icu version I'd recommend asking about that on the icu ticket. Even if icu doesn't release a prior patch, they might put a commit on the icu maint branch which could be picked up . I might even suggest contributing the back port there as a pr if someone is inclined. (I could see the argument for this being back ported)

  17. MrJithil commented on Oct 24, 2023

    @MrJithil
    Member

    Yes. I can create a patch to all the impacted versions.

  18. srl295 commented on Oct 24, 2023

    @srl295
    Member

    Yes. I can create a patch to all the impacted versions.

    I know you can. But what I'm recommending instead is replying on the upstream ICU ticket and asking about backports to prior versions. For example against branch https://github.com/unicode-org/icu/tree/maint/maint-73

    Basically, contribute it upstream - open a PR against that maint-73 branch instead of just doing the backporting downstream in Node. Then you'll have an exact patch to take from. Maybe even ICU would be willing to backport it, not sure

    [sorry hit the wrong button, didn't mean to close]

  19. reopened this on Oct 24, 2023
  20. MrJithil commented on Oct 25, 2023

    @MrJithil
    Member

    Yes. I can create a patch to all the impacted versions.

    I know you can. But what I'm recommending instead is replying on the upstream ICU ticket and asking about backports to prior versions. For example against branch https://github.com/unicode-org/icu/tree/maint/maint-73

    Basically, contribute it upstream - open a PR against that maint-73 branch instead of just doing the backporting downstream in Node. Then you'll have an exact patch to take from. Maybe even ICU would be willing to backport it, not sure

    [sorry hit the wrong button, didn't mean to close]

    You mean, something like this ? unicode-org/icu#2681

  21. DavidDudson commented on Apr 8, 2024

    @DavidDudson

    FYI - This has now been resolved by Apple (All previously broken versions of node work on both 14.3 and 14.4). So this issue can be closed.

  22. srl295 commented on Apr 8, 2024

    @srl295
    Member

    Yes. I can create a patch to all the impacted versions.

    I know you can. But what I'm recommending instead is replying on the upstream ICU ticket and asking about backports to prior versions. For example against branch https://github.com/unicode-org/icu/tree/maint/maint-73
    Basically, contribute it upstream - open a PR against that maint-73 branch instead of just doing the backporting downstream in Node. Then you'll have an exact patch to take from. Maybe even ICU would be willing to backport it, not sure
    [sorry hit the wrong button, didn't mean to close]

    You mean, something like this ? unicode-org/icu#2681

    yes, but it's still draft.

  23. srl295 commented on Apr 8, 2024

    @srl295
    Member

    FYI - This has now been resolved by Apple (All previously broken versions of node work on both 14.3 and 14.4). So this issue can be closed.

    in any event, the backport is proposed there in ICU as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    icuIssues and PRs related to the ICU dependency.macosIssues and PRs related to the macOS platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions