Error: Unable to resolve module `async_hooks`

See original GitHub issue

Hello

I am attempting to run @airbrake/node in my react-native project. The versions I am running are:

When I run my mobile app with this install and using the notifier, I get the error: Error: Unable to resolve module async_hooks from node_modules/@airbrake/node/dist/airbrake.common.js

Do I need to install async_hooks? It’s not present in any of the package.json files in either browser, node or airbrake-js in general.

Happy to do a PR if that is the case

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vmihailencocommented, Nov 7, 2019

async_hooks is a Node.js core module - it should be available automatically.

Why don’t you use @airbrake/browser with React native? I am not familiar with React native so I can miss something obvious…

0reactions
builtbyproxycommented, Nov 10, 2019

Update, this wasn’t anything to do with Airbrake sorry, my jest was running as well and I was getting this error from tests.

The fix was to add to my jest config in my package.json:

"globals": {
    "window": {}
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'async_hooks' - Stack Overflow
The problem with 'async_hooks' is that it will only be available in node on serverside - if e.g. webpack tries to create a...
Read more >
Nodejs APM - Can't resolve 'async_hooks' - Elastic Discuss
We are trying to use APM for our React nodejs app. We have added the dependency in our package.json to install the elastic-apm-node...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
Async hooks | Node.js v19.3.0 Documentation
Error handling; Printing in AsyncHook callbacks. Class: AsyncHook ... The node:async_hooks module provides an API to track asynchronous resources.
Read more >
[Solved]-Module not found: Can't resolve 'async_hooks'-Reactjs
Related Query · How to fix this error : " Module not found :can't resolve popper. · "module not found : Error: Cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found