Skip to content

Workaround for Node.js 16+ on Apple Silicon M1 #27031

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Jul 12, 2021
Merged

Conversation

styfle
Copy link
Member

@styfle styfle commented Jul 9, 2021

This PR is a workaround for #24421 by adding an artificial delay when Apple M1 + buggy Node.js is detected.

Node.js 14 is unaffected because it M1 still reports arch=x64. Starting in Node.js 16, M1 reports arch=arm64.

V8 Bug: https://crbug.com/1224882

Node.js Issue: nodejs/node#39327

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Jul 9, 2021
@styfle styfle requested review from ijjk and timneutkens July 9, 2021 00:14
@ijjk

This comment has been minimized.

@styfle styfle changed the title Fix Node.js 16 on Apple Silicon M1 Fix Node.js 16+ on Apple Silicon M1 Jul 9, 2021
@styfle styfle changed the title Fix Node.js 16+ on Apple Silicon M1 Workaround for Node.js 16+ on Apple Silicon M1 Jul 9, 2021
@styfle styfle marked this pull request as ready for review July 9, 2021 22:30
@styfle styfle requested review from huozhi, padmaia and shuding as code owners July 9, 2021 22:30
@styfle styfle requested a review from ijjk July 12, 2021 15:17
@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Jul 12, 2021

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
buildDuration 14.8s 14.9s ⚠️ +143ms
buildDurationCached 3.4s 3.5s ⚠️ +103ms
nodeModulesSize 49.3 MB 49.3 MB ⚠️ +2.44 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
/ failed reqs 0 0
/ total time (seconds) 2.515 2.582 ⚠️ +0.07
/ avg req/sec 994.18 968.37 ⚠️ -25.81
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.568 1.6 ⚠️ +0.03
/error-in-render avg req/sec 1594.21 1562.32 ⚠️ -31.89
Client Bundles (main, webpack, commons)
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
359.HASH.js gzip 3.09 kB 3.09 kB
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.9 kB 20.9 kB
webpack-HASH.js gzip 1.49 kB 1.49 kB
Overall change 67.6 kB 67.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
_app-HASH.js gzip 803 B 803 B
_error-HASH.js gzip 3.18 kB 3.18 kB
amp-HASH.js gzip 526 B 526 B
css-HASH.js gzip 329 B 329 B
hooks-HASH.js gzip 903 B 903 B
image-HASH.js gzip 5.69 kB 5.69 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 319 B 319 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 14.1 kB 14.1 kB
Client Build Manifests
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
_buildManifest.js gzip 419 B 419 B
Overall change 419 B 419 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
index.html gzip 531 B 531 B
link.html gzip 544 B 544 B
withRouter.html gzip 524 B 524 B
Overall change 1.6 kB 1.6 kB

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
buildDuration 12.2s 12s -168ms
buildDurationCached 4.9s 4.6s -385ms
nodeModulesSize 49.3 MB 49.3 MB ⚠️ +2.44 kB
Page Load Tests Overall increase ✓
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
/ failed reqs 0 0
/ total time (seconds) 2.696 2.581 -0.12
/ avg req/sec 927.22 968.62 +41.4
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.57 1.598 ⚠️ +0.03
/error-in-render avg req/sec 1592.78 1564.43 ⚠️ -28.35
Client Bundles (main, webpack, commons)
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
14.HASH.js gzip 3.11 kB 3.11 kB
677f882d2ed8..HASH.js gzip 13.9 kB 13.9 kB
framework.HASH.js gzip 41.8 kB 41.8 kB
main-HASH.js gzip 8.17 kB 8.17 kB
webpack-HASH.js gzip 1.19 kB 1.19 kB
Overall change 68.1 kB 68.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
_app-HASH.js gzip 791 B 791 B
_error-HASH.js gzip 3.83 kB 3.83 kB
amp-HASH.js gzip 531 B 531 B
css-HASH.js gzip 333 B 333 B
hooks-HASH.js gzip 910 B 910 B
index-HASH.js gzip 230 B 230 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 297 B 297 B
withRouter-HASH.js gzip 293 B 293 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 8.98 kB 8.98 kB
Client Build Manifests
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
_buildManifest.js gzip 418 B 418 B
Overall change 418 B 418 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js fix-m1-with-delay Change
index.html gzip 576 B 576 B
link.html gzip 587 B 587 B
withRouter.html gzip 569 B 569 B
Overall change 1.73 kB 1.73 kB
Commit: 4ca54ac

@kodiakhq kodiakhq bot merged commit ed19335 into canary Jul 12, 2021
@kodiakhq kodiakhq bot deleted the fix-m1-with-delay branch July 12, 2021 17:05
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Aug 19, 2021
This PR is a workaround for vercel#24421 by adding an artificial delay when Apple M1 + buggy Node.js is detected.

Node.js 14 is unaffected because it M1 still reports `arch=x64`. Starting in Node.js 16, M1 reports `arch=arm64`.

V8 Bug: https://crbug.com/1224882

Node.js Issue: nodejs/node#39327
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants