Issue Deploying Forge App: async_hooks Module Not Found

Hi Atlassian Developer Community,

I’m working on a Forge app called BOT-AI-PEOPLE-CHILE and have set up all the necessary files (manifest.yml, index.js, index.jsx). However, I keep hitting an error when trying to deploy the app with forge deploy:

Error: Bundling failed: Module not found: Error: Can’t resolve ‘async_hooks’ in ‘/Users/matiasmatthews/BOT-AI-PEOPLE-CHILE/node_modules/@forge/api/out/api’

Environment Details:

Forge CLI Version: 10.11.0
Node.js Version: I’ve tried both Node.js 18 and Node.js 20, but I get the same error with both.
Operating System: macOS Sequoia Version 15.1 (24B83)
Dependencies:

  • I’m using @forge/api and @forge/ui as recommended in the Forge docs.
  • I tried forcing an older version of @forge/api (2.6.0), but it didn’t help.

Troubleshooting Steps I’ve Already Tried:

  1. Reinstalled @forge/api with different versions (including 2.6.0).
  2. Deleted and reinstalled all dependencies (node_modules and package-lock.json).
  3. Updated Forge CLI to the latest version (10.11.0).
  4. Tested both Node.js 18 and 20 to make sure the Node version isn’t the issue.
  5. Tried manually adding async_hooks, but that didn’t fix it, so I assume it’s something internal to Forge.

Question:

Is there a known fix or workaround for this async_hooks error? It seems like it could be related to an internal dependency in @forge/api. Any guidance on how to handle this would be really appreciated, as it’s blocking me from moving forward with my app.

Thanks a lot for the help, and if there’s any temporary fix I could try, that’d be great to know!

Best,
Matías Matthews

1 Like

I had the same error and it goes away if I use: “@forge/api”: “4.0.0”

Update your dependencies in your package.json and then run ‘npm i’:

“dependencies”: {
@forge/api”: “4.0.0”,
@forge/bridge”: “4.1.0”,
@forge/react”: “10.7.0”,
@forge/resolver”: “1.6.1”,
“react”: “^18.2.0”
}

I haven’t made it too far into validating that storage works, but the error goes away and you can deploy.

1 Like

Thanks so much for this workaround. Was driving me crazy ever since upgrading @forge/cli to 10.11 yesterday.

I just ran into this error. I would interpret it as “double-check your frontend dependencies aren’t pulling in libs intended for the resolvers”.

For my case, I was bootstrapping a new app and adding Typescript:

├── manifest.yml
├── package-lock.json
├── package.json
├── src
│   ├── frontend
│   │   └── index.tsx
│   ├── index.ts
│   └── resolvers
│       ├── index.ts
└── tsconfig.json

I started writing a type and default object, which frontend would get from invoking the resolver. I put those into the ./resolvers/index.ts, then imported them into ./frontend/index.tsx. And that meant @forge/resolver was getting imported for the frontend code, which is what tripped the bundling error. The solution was to extract my “DTOs” to a separate file without imports. Both frontend and resolvers can share these now, without extraneous imports.

1 Like

I’m still getting this error and have tried the solutions that Matt recommended as well as double checked for frontend dependencies pulling in libraries for resolvers.

This error occurs also for all tutorial and example apps that I’ve tried that use forge/api