React-native: Unable resolve module react-native/Libraries/Components/StaticContainer.react

Created on 17 Apr 2017  路  8Comments  路  Source: facebook/react-native

Hi, i have this error when i try compile my app for debug

Transforming modules  鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒  99.6% (976/979)...(node:14514) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2723): UnableToResolveError: Unable to resolve module `react-native/Libraries/Components/StaticContainer.react` from `/home/unfernandito/Luis/Proyectos/WeHaus/WeHaus-App/Old-Wehaus/node_modules/native-base/dist/src/basic/Tabs/SceneComponent.js`: Module does not exist in the module map or in these directories:
  /home/unfernandito/Luis/Proyectos/WeHaus/WeHaus-App/Old-Wehaus/node_modules/native-base/node_modules/react-native/Libraries/Components
,   /home/unfernandito/Luis/Proyectos/WeHaus/WeHaus-App/Old-Wehaus/node_modules/react-native/Libraries/Components
,   /home/unfernandito/Luis/Proyectos/node_modules/react-native/Libraries/Components

these are my package.json:
{ "name": "Wehaus", "version": "1.0.12", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "devtools": "react-devtools" }, "dependencies": { "buffer": "^5.0.5", "events": "^1.1.1", "faye": "^1.2.4", "halley": "^0.4.7", "lodash": "^4.17.4", "native-base": "^2.1.2", "pusher": "^1.5.1", "pusher-js": "^4.0.0", "react": "15.4.2", "react-native": "^0.42.0", "react-native-action-button": "^2.6.0", "react-native-android-voice": "^0.5.1", "react-native-android-wifi": "0.0.13", "react-native-animatable": "^1.1.1", "react-native-app-intro": "^1.1.5", "react-native-chart": "^1.0.8-beta", "react-native-chooser": "^1.4.0", "react-native-easy-grid": "^0.1.8", "react-native-elements": "^0.9.7", "react-native-firestack": "^2.3.9", "react-native-fit-image": "^1.4.7", "react-native-highcharts": "^0.2.0", "react-native-linear-gradient": "^2.0.0", "react-native-loading-spinner-overlay": "^0.4.2", "react-native-modal-picker": "0.0.16", "react-native-net-state": "^1.1.2", "react-native-parallax-view": "^2.0.6", "react-native-pathjs-charts": "0.0.26", "react-native-responsive-dimensions": "^1.0.1", "react-native-responsive-image": "^2.0.2", "react-native-rest-client": "^0.1.1", "react-native-shake-event": "^3.0.0", "react-native-sortable-listview": "^0.2.2", "react-native-splash-screen": "^2.0.0", "react-native-store": "^0.4.1", "react-native-swiper": "^1.5.4", "react-native-textinput-effects": "^0.3.0", "react-native-touch-id": "^3.0.0", "react-native-vector-icons": "^4.0.0", "react-navigation": "^1.0.0-beta.5", "react-redux": "^5.0.3", "redux": "^3.6.0", "restler": "^3.4.0", "util": "^0.10.3" }, "devDependencies": { "babel-jest": "19.0.0", "babel-preset-react-native": "1.9.1", "flow-bin": "^0.42.0", "jest": "19.0.2", "react-devtools": "^2.0.12", "react-test-renderer": "15.4.2" }, "jest": { "preset": "react-native" } }

Locked

Most helpful comment

Open SceneComponent.js in ~/node_modules/native-base/dist/src/basic/Tabs/

and change line 6 from

var StaticContainer=require('react-native/Libraries/Components/StaticContainer.react');

to

var StaticContainer=require('react-native/Libraries/Components/StaticContainer');

Don't forget to perform a npm start -- --reset-cache

It works for me !

Source : http://stackoverflow.com/questions/43453525/react-native-not-generating-file-for-android

All 8 comments

Open SceneComponent.js in ~/node_modules/native-base/dist/src/basic/Tabs/

and change line 6 from

var StaticContainer=require('react-native/Libraries/Components/StaticContainer.react');

to

var StaticContainer=require('react-native/Libraries/Components/StaticContainer');

Don't forget to perform a npm start -- --reset-cache

It works for me !

Source : http://stackoverflow.com/questions/43453525/react-native-not-generating-file-for-android

Also issue for me, but this is native base's issue, not react-native

@Clowning works for me, thanks you!

Wow @Clowning , thank you so much!

@unfernandito @brascene You're welcome :-)

@Clowning Thanks you ;-)

Thank you !!!

I was getting this error and it was a silly mistake. I'm sure most of you don't do this:

I was importing the file like this : import file from 'file';
But actual way was : import file from './file';

That works.
P.S. I also run the command "yarn" before doing above change.

Was this page helpful?
0 / 5 - 0 ratings