Skip to content

Commit 6be3b25

Browse files
authored
fix: download button pointing to an incorrect binary on Windows arm64 (#7240)
* Fix Download button pointing to an incorrect binary on Windows arm64 Closes #7239 This PR changes the way DownloadButton calculates `bitness` which gets passed to `getNodeDownloadUrl`. Previously, this value was passed directly from `useDetectOS()` without any further processing, leading to the issue mentioned above. After this change, `bitness` is calculated similarly to how it's done in `BitnessDropdown`, so: by passing `architecture` and `bitness` to `getUserBitnessByArchitecture`: https://github.com/nodejs/nodejs.org/blob/c5345f551ea545cf9d04017204b17f3099940ada/apps/site/components/Downloads/Release/BitnessDropdown.tsx#L16-L29 Signed-off-by: Wojciech Maj <[email protected]> * Fix formatting --------- Signed-off-by: Wojciech Maj <[email protected]>
1 parent 52e04b0 commit 6be3b25

File tree

1 file changed

+7
-1
lines changed
  • apps/site/components/Downloads/DownloadButton

1 file changed

+7
-1
lines changed

apps/site/components/Downloads/DownloadButton/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Button from '@/components/Common/Button';
88
import { useDetectOS } from '@/hooks';
99
import type { NodeRelease } from '@/types';
1010
import { getNodeDownloadUrl } from '@/util/getNodeDownloadUrl';
11+
import { getUserBitnessByArchitecture } from '@/util/getUserBitnessByArchitecture';
1112

1213
import styles from './index.module.css';
1314

@@ -17,7 +18,12 @@ const DownloadButton: FC<PropsWithChildren<DownloadButtonProps>> = ({
1718
release: { versionWithPrefix },
1819
children,
1920
}) => {
20-
const { os, bitness } = useDetectOS();
21+
const {
22+
os,
23+
bitness: userBitness,
24+
architecture: userArchitecture,
25+
} = useDetectOS();
26+
const bitness = getUserBitnessByArchitecture(userArchitecture, userBitness);
2127
const downloadLink = getNodeDownloadUrl(versionWithPrefix, os, bitness);
2228

2329
return (

0 commit comments

Comments
 (0)