question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native - Unable to resolve 'os'

See original GitHub issue

Using this guide from the documentation.

Import it like this

import { Component } from 'react'

import AirbrakeClient from 'airbrake-js'

export default class ErrorBoundary extends Component {
  constructor(props) {
    super(props)
    this.airbrake = new AirbrakeClient({
      projectId: 1,
      projectKey: 'excluded_for_example'
    })
  }

  componentDidCatch(error, info) {
    this.airbrake.notify({
      error: error,
      params: { info: info }
    })
  }

  render() {
    return this.props.children
  }
}

then wrapped my RootComponent in ErrorBoundary like this

        <ErrorBoundary>
          <RootContainer />
        </ErrorBoundary>

I get the following error on both Android and iOS

error: bundling failed: Error: Unable to resolve module `os` from `/Users/{...}/node_modules/airbrake-js/dist/client.js`: Module `os` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    at ModuleResolver.resolveDependency (/Users/{...}/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:167:1306)
    at ResolutionRequest.resolveDependency (/Users/{...}/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:80:16)
    at DependencyGraph.resolveDependency (/Users/{...}/node_modules/metro/src/node-haste/DependencyGraph.js:237:485)
    at Object.resolve (/Users/{...}/node_modules/metro/src/lib/transformHelpers.js:116:25)
    at dependencies.map.result (/Users/{...}/node_modules/metro/src/DeltaBundler/traverseDependencies.js:298:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/{...}/node_modules/metro/src/DeltaBundler/traverseDependencies.js:294:16)
    at /Users/{...}/node_modules/metro/src/DeltaBundler/traverseDependencies.js:159:33
    at Generator.next (<anonymous>)
    at step (/Users/{...}/node_modules/metro/src/DeltaBundler/traverseDependencies.js:239:307)

airbrake-js - 1.5.0

Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
palodelincakcommented, Mar 14, 2019

This issue is still existing even with the latest 1.6.5 version. I can confirm that the 1.2.0 version works fine.

Are you going to fix this issue for upcoming versions?

0reactions
builtbyproxycommented, Nov 8, 2019

Thanks for getting back to me vmihailenco, in order to not distract the participants of this thread, lets continue this here https://github.com/airbrake/airbrake-js/issues/610

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Resolve Module in React Native App - Stack Overflow
I'm getting an error in React Native saying it can't resolve a module. It's saying a certain folder doesn't exist but the path...
Read more >
Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like...
Read more >
unable to resolve module deprecated-react-native-prop-types
Uninstall react-navigation and install react-navigation 3.0. Create app container like this. I try clear cache, delete node_modules, run.
Read more >
Error: Unable to resolve module `util` – Split Help Center
Issue Build Environment react: 16.3.0react-native: 0.55.0 Steps to reproduce When running the bundle, following error occurrs: bundling...
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change ' react -scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ......
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