workers-sdk
workers-sdk copied to clipboard
dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT
What versions & operating system are you using?
wrangler 4.16.1, pnpm 10.11.0, node 22.16.0, macOS 11.7.10
Please provide a link to a minimal reproduction
No response
Describe the Bug
➜ Desktop pnpx wrangler init
⛅️ wrangler 4.16.1
-------------------
Using pnpm as package manager.
🌀 Running `pnpm create cloudflare@^2.5.0`...
────────────────────────────────────────────────────────────
👋 Welcome to create-cloudflare v2.47.2!
🧡 Let's get started.
────────────────────────────────────────────────────────────
╭ Create an application with Cloudflare Step 1 of 3
│
├ In which directory do you want to create your application?
│ dir ./foo
│
├ What would you like to start with?
│ category Framework Starter
│
├ Which development framework do you want to use?
│ framework Astro
│
├ Select your deployment platform
│ platform Workers with Assets
│
├ Continue with Astro via `pnpm dlx [email protected] foo --no-install`
│
astro Launch sequence initiated.
◼ dir Using foo as project directory
tmpl How would you like to start your new project?
Use minimal (empty) template
◼ No problem! Remember to install dependencies after setup.
git Initialize a new git repository?
No
◼ Sounds good! You can always run git init manually.
✔ Project initialized!
■ Template copied
next Liftoff confirmed. Explore your project!
Enter your project directory using cd ./foo
Run pnpm dev to start the dev server. CTRL+C to stop.
Add frameworks like react or tailwind using astro add.
Stuck? Join us at https://astro.build/chat
╭─────╮ Houston:
│ ◠ ◡ ◠ Good luck out there, astronaut! 🚀
╰─────╯
├ Copying template files
│ files copied to project directory
│
├ Installing dependencies
│ installed via `pnpm install`
│
╰ Application created
╭ Configuring your application for Cloudflare Step 2 of 3
│
├ Installing wrangler A command line tool for building Cloudflare Workers
│ installed via `pnpm install wrangler --save-dev`
│
├ Retrieving current workerd compatibility date
│ compatibility date 2025-05-23
│
├ Installing adapter
│ installed via `pnpm astro add cloudflare`
│
├ Updating configuration in astro.config.mjs
│
├ Adding Wrangler files to the .gitignore file
│ updated .gitignore file
│
├ Updating `package.json` scripts
│ updated `package.json`
│
├ Generating types for your application
│
> [email protected] cf-typegen /Users/Henrikh/Desktop/foo
> wrangler types
⛅️ wrangler 4.16.1
-------------------
Generating project types...
declare namespace Cloudflare {
interface Env {
ASSETS: Fetcher;
}
}
interface Env extends Cloudflare.Env {}
Generating runtime types...
dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT
✘ [ERROR] write EPIPE
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
? Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue.
🤖 Using fallback value in non-interactive context: no
🪵 Logs were written to "/Users/Henrikh/Library/Preferences/.wrangler/logs/wrangler-2025-05-23_16-36-09_956.log"
ELIFECYCLE Command failed with exit code 1.
│
╰ ERROR Error:
> [email protected] cf-typegen /Users/Henrikh/Desktop/foo
> wrangler types
⛅️ wrangler 4.16.1
-------------------
Generating project types...
declare namespace Cloudflare {
interface Env {
ASSETS: Fetcher;
}
}
interface Env extends Cloudflare.Env {}
Generating runtime types...
dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT
✘ [ERROR] write EPIPE
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
? Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue.
🤖 Using fallback value in non-interactive context: no
🪵 Logs were written to "/Users/Henrikh/Library/Preferences/.wrangler/logs/wrangler-2025-05-23_16-36-09_956.log"
ELIFECYCLE Command failed with exit code 1.
Please provide any relevant error logs
--- 2025-05-23T16:36:10.110Z debug
🪵 Writing logs to "/Users/Henrikh/Library/Preferences/.wrangler/logs/wrangler-2025-05-23_16-36-09_956.log"
---
--- 2025-05-23T16:36:10.110Z debug
Metrics dispatcher: Dispatching disabled - would have sent {"deviceId":"86bf7f74-5cd5-43ea-93b9-3af84dce2a61","event":"wrangler command started","timestamp":1748018170110,"properties":{"amplitude_session_id":1748018170108,"amplitude_event_id":0,"wranglerVersion":"4.16.1","osPlatform":"Mac OS","osVersion":"Darwin Kernel Version 20.6.0: Thu Jul 6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64","nodeVersion":22,"packageManager":"pnpm","isFirstUsage":false,"configFileType":"jsonc","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":false,"hasAssets":true,"argsUsed":[],"argsCombination":"","command":"wrangler types","args":{"xJsonConfig":true,"j":true,"envInterface":"<REDACTED>","includeRuntime":true,"includeEnv":true,"strictVars":true,"path":"worker-configuration.d.ts"}}}.
---
--- 2025-05-23T16:36:10.113Z debug
.env file not found at ".env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---
--- 2025-05-23T16:36:10.125Z log
⛅️ wrangler 4.16.1
-------------------
---
--- 2025-05-23T16:36:10.132Z log
Generating project types...
---
--- 2025-05-23T16:36:10.133Z debug
.env file not found at ".dev.vars". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---
--- 2025-05-23T16:36:10.134Z log
declare namespace Cloudflare {
interface Env {
ASSETS: Fetcher;
}
}
interface Env extends Cloudflare.Env {}
---
--- 2025-05-23T16:36:10.134Z log
Generating runtime types...
---
Does anyone know a workaround? I'm trying to follow https://developers.cloudflare.com/workers/get-started/guide/ and am stuck on this (except trying to use npm not pnpm): "[ERROR] dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT" -- and I apparently need to kill my terminal to get out of this. I tried going back to Node.js 20, but same issue. I tried going back to Node.js 18, and I got: "Wrangler requires at least Node.js v20.0.0. You are using v18.20.8. Please update your version of Node.js." I tried deleting node_modules, deleting package-lock.json, and npm install -D wrangler@3. It struggles, but eventually I was able to install it. Then "npx wrangler dev" and back to the original issue "No bindings found." and "[ERROR] dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT"... and have to kill my terminal. I guess I have to buy a new MacBook?
Some background to this error message: https://medium.com/tokopedia-engineering/a-curious-case-of-mach-o-executable-26d5ecadd995
There are a lot of moving parts in the issue description, you are using C3 to trigger Astro to create a project, then npm run cf-typegen` is running npm that runs Node that runs a Worker that generates typings.
It would be great if we could get a minimal reproduction of this issue.
For example does npx wrangler whoami work on your machine? What about creating the simplest hello world Worker and then running npx wrangler build? Then npx wrangler dev?
Also can you check your setup and see if you have anything unusual installed on your Mac? Perhaps an old version of XCode?
Hey @petebacondarwin,
Thanks for taking a look!
-
pnpx wrangler whoamiworks -
pnpm create cloudflare@latest my-first-workerfails
-
pnpm wrangler buildworks,pnpm wrangler devfails
P.S. I'm on an old version of macOS (Big Sur, 11.7.10) so that's probably the issue.
I think your MacOS version is the issue. Sorry. We only support 13.5+.
See https://developers.cloudflare.com/workers/wrangler/install-and-update/#:~:text=Wrangler%20is%20only%20supported%20on%20macOS%2013.5%2B
Closing as this is "not working" as expected.