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

TypeError: undefined is not an object (evaluating 'GLOBAL.Text... #4811

Closed
jayli opened this issue Dec 16, 2015 · 6 comments
Closed

TypeError: undefined is not an object (evaluating 'GLOBAL.Text... #4811

jayli opened this issue Dec 16, 2015 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jayli
Copy link

jayli commented Dec 16, 2015

hi

I can't run the 'HelloWorld' successfully. I don't know what's wrong.

I have just installed [email protected] [email protected] [email protected] [email protected]. And I have initialized a new prject with react-native init HelloWorld without any error. Then hit run in Xcode. It shows me this:

TypeError: undefined is not an object (evaluating 'GLOBAL.Text = {
get defaultProps(){
throw getInvalidGlobalUseError('Text');}}')

This file throw an exception:

node_modules/react-native/Libraries/JavaScriptAppEngine/polyfills/document.js.

'GLOBAL' is undefined? node_modules/react-native/package.json shows version is 0.17.0-rc. Is it the correct version? How to fix this?

@facebook-github-bot
Copy link
Contributor

Hey jayli, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@jayli
Copy link
Author

jayli commented Dec 16, 2015

here is the solution

I reinstall the 'preset-react', remove the "presets": ["es2015"] from ~/.babelrc. Then add "presets": ["react"] to this file.

@jayli jayli closed this as completed Dec 16, 2015
@natdm
Copy link

natdm commented Dec 16, 2015

I'm having the exact same issue, though I was always able to run projects fine in the past. I don't have a ~/.babelrc folder. Am I supposed to have created one? Is that something new?

@jayli
Copy link
Author

jayli commented Dec 17, 2015

@natdm

You can create a new file called .babelrc

@natdm
Copy link

natdm commented Dec 17, 2015

that worked, thanks!

@ghost
Copy link

ghost commented Dec 22, 2015

Put this in your .babelrc:

{
    "extends": "react-native/packager/react-packager/.babelrc"
}

And that's it - you copy react-native settings for your whole project (so no conflict).

ghost referenced this issue Dec 22, 2015
Reviewed By: vjeux

Differential Revision: D2626155

fb-gh-sync-id: e919c8fb8bbf139bcd979ee2738c7ec4fc9eba74
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 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

4 participants