Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined is not an object (evaluating n.reactCurrentOwner #14851

Closed
Aroniez opened this issue Jul 6, 2017 · 10 comments
Closed

undefined is not an object (evaluating n.reactCurrentOwner #14851

Aroniez opened this issue Jul 6, 2017 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Aroniez
Copy link

Aroniez commented Jul 6, 2017

After adding all my necessary npm packages on my app and try to run, I'm en counteracting this bug. I have tried the following and still same bug

watchman watch-del-all
rm -rf ./node_modules
yarn cache clean
rm -rf $TMPDIR/react-*
yarn install
npm start -- --reset-cache

I've also tried to update everything to latest version and still same bug. i.e

react-native: 0.45
react: 16.0.0-alpha.12

Anybody else with similar issue?

Environment

react-native-cli: 1.0.0
react-native: 0.44.0
react: 16.0.0-alpha.6
node: v6.10.0
npm: 4.5.0
yarn: 0.27.5

Platform: Android
OS: Windows
Android Studio

Steps to Reproduce

react-native run-android

Expected Behavior

It's supposed to show app main page

parsing template literals

Actual Behavior
red error page with
undefined is not an object (evaluating n.reactCurrentOwner

@brentvatne
Copy link
Collaborator

Hi there! Is this happening for you on a blank React Native project? react-native init SomeProject and then react-native run-android causes the problem for you? If not, can you share an example project with this happening? Thanks!

@DevHossamHassan
Copy link

I'm stuck on this issue too,
I'm currently using those versions:

react: 16.0.0-alpha.12
react-native: 0.45.1
npm: 5.0.3
node: v8.1.3
yarn: v0.24.6

@crazyx13th
Copy link

crazyx13th commented Jul 11, 2017

hi there,
same problem here. sdk17 works, sdk18 not :-/

app.js

import React from 'react';
import {Text, View, AppRegistry} from "react-native";

export default class App extends React.Component {
    constructor() {
        super();
    }
    render() {
        return (
            <View style={{
                margin: 50
            }}>
                <Text>Hallo 1.0.1</Text>
            </View>
        );
    }
}
AppRegistry.registerComponent('main', () => App);

package.json

{
	"name": "nacked-app",
	"version": "1.0.0",
	"private": true,
	"scripts": {
		"exp-start": "exp start --clear",
		"exp-build-ios": "exp build:ios",
		"exp-build-android": "exp build:android",
		"exp-build-status": "exp build:status",
		"reset1": "rimraf \"C:/Users/xxxxxxxxx/AppData/Roaming/npm-cache/*\"",
		"reset2": "rimraf \"C:/Users/xxxxxxxxx/AppData/Local/Temp/react-*\"",
		"reset3": "rimraf \"C:/Users/xxxxxxxxx/AppData/Local/Temp/npm-*\"",
		"reset4": "rimraf node_modules",
		"reset5": "npm cache clean",
		"reset6": "npm i",
		"reset7": "node node_modules/react-native/local-cli/cli.js start --reset-cache",
		"log1": "node node_modules/react-native/local-cli/cli.js log-android"
	},
	"dependencies": {
		"expo": "18.0.0",
		"react": "16.0.0-alpha.6",
		"react-native": "github:exponent/react-native#sdk-18.0.0"
	},
	"devDependencies": {
		"cross-env": "5.0.1",
		"exp": "42.1.0",
		"npm-check-updates": "2.12.1",
		"rimraf": "2.6.1"
	}
}

exp.json

{
	"version": "1.0.0",
	"name": "nackedapp",
	"slug": "nackedapp",
	"privacy": "unlisted",
	"entryPoint": "app.js",
	"icon": "expo.png",
	"orientation": "portrait",
	"sdkVersion": "18.0.0",
	"packagerOpts": {
		"assetExts": [
			"ttf"
		]
	},
	"loading": {
		"icon": "src/icons/expo.png"
	},
	"ios": {
		"bundleIdentifier": "com.nackedapp.exp.ios",
		"config": {
			"usesNonExemptEncryption": false
		}
	},
	"android": {
		"package": "com.nackedapp.exp.android"
	}
}

thanks!

greetings crazyx13th

@crazyx13th
Copy link

works again with:

"expo": "18.0.9",
"react-native": "0.46.1"

@crazyx13th
Copy link

sorry,
"react": "16.0.0-alpha.6" i got this error
"react": "16.0.0-alpha.7" i got another error
"react": "16.0.0-alpha.8" seems to works

@Aroniez
Copy link
Author

Aroniez commented Jul 12, 2017

blank project from react-native init somename works fine. The issue is actually when I build a debug or release apk and run it. running react-native run-android works fine. Not sure what's being broken on building apk and installing it on device/emulator. here is my package.json

{
  "name": "my app",
  "version": "1.0.0",
  "description": "My coolest app",
  "author": "Aroniez",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "firebase": "^3.6.4",
    "html-entities": "^1.2.1",
    "lodash": "^4.17.2",
    "moment": "^2.17.1",
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.2",
    "react-native-admob": "^1.3.0",
    "react-native-animatable": "^1.1.1",
    "react-native-blur": "^3.0.0-alpha",
    "react-native-drawer": "2.*",
    "react-native-dropdownalert": "^2.3.0",
    "react-native-fbsdk": "^0.6.0",
    "react-native-fence-html": "^1.0.6",
    "react-native-google-analytics-bridge": "^5.0.1",
    "react-native-google-signin": "^0.10.0",
    "react-native-invertible-scroll-view": "^1.0.0",
    "react-native-linear-gradient": "^2.0.0",
    "react-native-modalbox": "^1.3.9",
    "react-native-onesignal": "^3.0.4",
    "react-native-render-html": "^2.0.0",
    "react-native-scrollable-tab-view": "0.*",
    "react-native-snap-carousel": "2.1.1",
    "react-native-swiper": "1.*",
    "react-native-timeago": "0.*",
    "react-native-vector-icons": "^4.2.0",
    "react-navigation": "^1.0.0-beta.11",
    "react-redux": "^5.0.4",
    "react-timer-mixin": "^0.13.3",
    "react-tween-state": "^0.1.5",
    "redux": "^3.6.0",
    "redux-persist": "^4.8.0",
    "redux-thunk": "^2.2.0",
    "sanitize-html": "^1.13.0",
    "striptags": "^3.0.1",
    "urijs": "^1.18.4",
    "url": "^0.11.0",
    "util": "^0.10.3",
    "wpapi": "^1.1.1"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "1.9.2",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.6"
  },
  "jest": {
    "preset": "react-native"
  }
}

@Aroniez
Copy link
Author

Aroniez commented Jul 12, 2017

@crazyx13th "react": "16.0.0-alpha.8" works fine?

@crazyx13th
Copy link

yupp, inside my minimal test project

@Aroniez
Copy link
Author

Aroniez commented Jul 12, 2017

Let me try that

@L1fescape
Copy link

L1fescape commented Jul 27, 2017

I'm experiencing a similar issue issue when trying to add react-native-web to an existing react-native project: Cannot read property 'ReactCurrentOwner' of undefined. react-native-web currently requires react v15.4.x which is a different version than the one installed with the current version of react-native. To fix the issue I had to downgrade react-native to 0.42.3 (which uses react ~15.4.0 as a peer dependency) and set react, react-dom, and react-test-renderer to 15.4.1.

tl;dr make sure the versions of react in your dependencies are matching.

@Aroniez Aroniez closed this as completed Aug 25, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Aug 25, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants