You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intl.DateTimeFormat().resolvedOptions().timeZoneundefined on MacOS 14.0 (Sonoma) #50301
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)
$ 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'
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?
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.
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)
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]
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]
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]
Activity
targos commentedon Oct 20, 2023
Can't reproduce. Am I missing something?
bnoordhuis commentedon Oct 20, 2023
@gimyboya what does
echo $TZprint on your system?You can probably work around the issue by setting TZ to some known-good value, for example:
targos commentedon Oct 20, 2023
@bnoordhuis TZ is not set in my environment.
targos commentedon Oct 20, 2023
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?
khawarizmus commentedon Oct 21, 2023
@targos I am using nvm 0.39.1 to install different node versions. and TZ is not set in my environment.
DavidDudson commentedon Oct 22, 2023
We are also getting this. 18.18.2 returns undefined, 18.16.0 returns the correct value. using nvm aswell.
DavidDudson commentedon Oct 22, 2023
DavidDudson commentedon Oct 22, 2023
It looks like the fix is actually in ICU 74.
dburles commentedon Oct 23, 2023
I'm pretty certain this affects Node >= 18.18.2
MrJithil commentedon Oct 23, 2023
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.
targos commentedon Oct 23, 2023
@srl295 What do you think? Are we close to the ICU 74 release? Should we cherry-pick the fix in the mean time?
richardlau commentedon Oct 23, 2023
FWIW we have docs on how to float patches for ICU: https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-icu.md#floating-patches-to-icu
It's not just a case of cherry-picking -- some reasoning was documented in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-icu.md#why-not-just-modify-the-icu-source-directly
srl295 commentedon Oct 23, 2023
@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
srl295 commentedon Oct 23, 2023
unicode-org/icu#2664 is the pr that un breaks the nodejs build.
srl295 commentedon Oct 23, 2023
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)
MrJithil commentedon Oct 24, 2023
Yes. I can create a patch to all the impacted versions.
srl295 commentedon Oct 24, 2023
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]
MrJithil commentedon Oct 25, 2023
You mean, something like this ? unicode-org/icu#2681
DavidDudson commentedon Apr 8, 2024
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.
srl295 commentedon Apr 8, 2024
yes, but it's still draft.
srl295 commentedon Apr 8, 2024
in any event, the backport is proposed there in ICU as well.