vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.92k stars 26.87k forks source link

[arm64][appDir] generateBuildId does't work properly; nextjs build doesn't generate same chunk hash for main-app-[hash].js #45659

Open SiarheiLazakovich opened 1 year ago

SiarheiLazakovich commented 1 year ago

Verify canary release

Provide environment information

MacBook Pro 2021 Apple M1 Max (macOS Ventura 13.2 (22D49))

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.3.0: Thu Jan  5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000
Binaries:
  Node: 16.17.0
  npm: 8.15.0
  Yarn: 1.22.19
  pnpm: N/A
Relevant packages:
  next: 13.1.7-canary.6
  eslint-config-next: 13.1.6
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

Link to the code that reproduces this issue

this example works perfect in cloud (x64) but if download and run locally (arm64) works wrong (see video and screenshot) example: https://stackblitz.com/edit/vercel-next-js-2m8zyx video: https://drive.google.com/file/d/1g_np1lkYjezVHlHDiByGSiRKu5E8URNq/view?usp=sharing

To Reproduce

  1. setup nextjs app npx create-next-app@latest --experimental-app
  2. add generateBuildId https://nextjs.org/docs/api-reference/next.config.js/configuring-the-build-id
  3. build yarn build
  4. open .next/static/chunks/main-app-[hash1].js
  5. remove .next folder rm -rf .next
  6. rebuild yarn build
  7. open .next/static/chunks/main-app-[hash2].js
  8. ensure that hash1 not equal hash2

Describe the Bug

generateBuildId does't work properly; nextjs build doesn't generate same chunk hash for main-app-[hash].js on rebuilds if nothing changed. reproduced only on arm64.

Expected Behavior

hash for main-app-[hash].js chunk keep the same on rebuilds if nothing changed.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

khalilsarwari commented 1 year ago

I am also having this issue, it applies to layout-[hash].js inside app folder as well; I also have appDir: true, and am also setting the same buildId

Marinashafiq commented 1 year ago

Having the same Issue with chunk hash, Is there any updates to solve it?

lonelil commented 1 year ago

same issue

UncleBloom commented 3 months ago

same issue applies to xxxx-[hash].js and main-app-[hash].js, when I run npm run build on two centOS machines. Those two has totally same project files(including .git folder)

UncleBloom commented 3 months ago

same issue applies to xxxx-[hash].js and main-app-[hash].js, when I run npm run build on two centOS machines. Those two has totally same project files(including .git folder)

Env Info: