Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

next/jest 12.3.6 Failed to load SWC binary for darwin/x64 #77569

Closed
JayCarney opened this issue Mar 28, 2025 · 2 comments
Closed

next/jest 12.3.6 Failed to load SWC binary for darwin/x64 #77569

JayCarney opened this issue Mar 28, 2025 · 2 comments
Labels
Testing Related to testing with Next.js.

Comments

@JayCarney
Copy link

Link to the code that reproduces this issue

https://github.com/JayCarney/minimal-nextjs-12.3.6-issue

To Reproduce

  1. Install dependencies
  2. run jest tests npm run test:ci
  3. Error: Failed to load SWC binary for darwin/x64

Current vs. Expected behavior

Current

Versions of next.js <= 12.3.4 will run the jest test suite, but 12.3.6 errors with Failed to load SWC binary for darwin/x64 even with .babelrc and swcMinify disabled as documented here

Image

Expected

npm run test:ci should execute the jest test suite

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.6.0: Thu Dec  5 23:45:11 PST 2024; root:xnu-8796.141.3.709.7~4/RELEASE_X86_64
    Binaries:
      Node: 18.20.8
      npm: 10.8.2
      Yarn: 1.22.17
      pnpm: N/A
    Relevant packages:
      next: 12.3.6
      eslint-config-next: N/A
      react: 18.3.1
      react-dom: 18.3.1

Which area(s) are affected? (Select all that apply)

Testing

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

Weird edge case

I found while trying to pin down a version this breaks; If you change to next 12.3.4 in package.json and do an install, tests will run correctly. Then swapping back to 12.3.6 will also now work even after blowing away node_modules and package-lock.json or yarn.lock.

I've tried this with node versions v18.20.8 and v22.14.0 and they both complain about Failed to load SWC binary for darwin/x64

@github-actions github-actions bot added the Testing Related to testing with Next.js. label Mar 28, 2025
@rmartins0
Copy link

Might be related to #77477 (comment)

@ijjk
Copy link
Member

ijjk commented Mar 28, 2025

Hi, we have updated the optionalDependencies for swc in v12.3.7 to lock to the previously available binaries so this should now be resolved. Please upgrade and give it a try!

@ijjk ijjk closed this as completed Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing Related to testing with Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants