-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
[0.19][ios]Error 'babelHelpers.typeof is not a function' running examples UIExplorer #5747
Comments
Hey asd123freedom, 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.
|
@asd123freedom I also got this upon upgrading. I tried clearing babel cache and the react native packager cache. It wasn't until I literally rebooted that it was resolved. Not the most concrete solution I understand, but this is eventually what solved it for me. I suspect there was something being cached somewhere in $TMP but couldn't track it down. |
@gijoehosaphat Thanks a lot. I will try it as soon as possible. By the way, the way of cleaning cache is remove related files in '/tmp', isn't it? |
@asd123freedom @gijoehosaphat the best way to make sure the packager cache is cleared is by doing: $ watchman watch-del-all
$ [packager command] --reset-cache |
For me, the fix was getting rid of |
@gijoehosaphat was the problem solved? |
I ended up not having to change any code in the project, and continue to use stage-0, es2015 and react babel presets. I believe it was just cache causing a conflict. |
cc @asd123freedom good to close? |
@bestander Because of Chinese new year I am in a vacation not having my mac aside. I will try the solution @gijoehosaphat suggested when I come back from vacation. So it's good to close. Thanks a lot. |
👍 reopen if it is still an issue |
I'm now running into this issue with v0.19.0, so I tried upgrading to v0.20.0 but I still run into the issue. Newly init'd projects work fine, but a project I started about a week ago is broken. I've tried all of the above suggestions with no luck. This morning I've done the following: And it still comes up with the undefined I was able to take my application specific code and basically dump that into a newly init'd project and it runs fine. I'd still like to know why my original repo is hosed though, and fix if possible. |
what does your package.json look like? |
I took it down to its bare minimum, trying to replicate a fresh
Previously there was more (See below), but I spent several hours adding and removing package dependencies to try and figure out if one of them was the problem. One step I did take last night was to
|
is something different from
Try to run
from your application folder first. UPD: Also, I'd like to see your |
@Kureev - ok thanks for the tip, I'll try that out once I'm back on that machine this afternoon. I don't have a .babelrc file, I did have a "babel" section within package.json which loaded the |
@Kureev awesome - the --reset-cache fixed it. |
@mikepugh I'm glad it helped you. |
I have the same problem for a fresh clean project created the project using |
I've tried all the above suggestions and am still running into this problem. I've been running
|
@prasanthu @lifehackett
I'm at
|
Did what @xuezhma told but it didn't fixed for me, any other solution? Thanks! |
@lifehackett @sambarboza Can you please share your |
@Kureev are these .babelrc configs global or per project? On the project folder I don't have this file. I've tried to run the packager command with --reset-cache. |
@Kureev I wasn't using a I have tried this setup as well and gotten the same results. .babelrc
package.json
|
@lifehackett you shouldn't extend react-native's babelrc file (since 0.20). Try using this https://github.com/facebook/react-native/tree/master/babel-preset instead of es2015. You can also check a list of transforms react-native preset gives you. |
@Kureev Same result |
@lifehackett @Kureev same thing here. |
I had been running into this issue for the last few days, just solved this by switching the {
"presets": ["stage-1", "stage-2", "stage-3", "react-native"],
"plugins": ["transform-decorators-legacy"],
} and my {
"private": true,
"name": "[REDACTED]",
"version": "0.0.0",
"scripts": {
"authenticate": "scripts/authenticate",
"bundle": "scripts/bundle:js",
"bundle:js": "scripts/bundle:js",
"clean": "scripts/clean:cache && scripts/clean:deps",
"clean:cache": "scripts/clean:cache",
"clean:deps": "scripts/clean:deps",
"postinstall": "scripts/postinstall",
"provision": "scripts/provision",
"publish": "scripts/publish",
"publish:all": "scripts/publish demo && scripts/publish production",
"publish:sourcemap": "scripts/publish:sourcemap",
"publish:codepush": "scripts/publish:codepush",
"shrinkwrap": "npm-shrinkwrap",
"start": "scripts/start",
"start:ios": "scripts/start:ios",
"test": "mocha --require babel/register"
},
"dependencies": {
"google-libphonenumber": "1.0.7",
"js-quantities": "1.6.0",
"lodash": "3.10.1",
"moment-timezone": "0.4.1",
"numeral": "1.5.3",
"pluralize": "1.2.1",
"raven-js": "1.3.0",
"react-addons-shallow-compare": "0.14.0",
"react-addons-update": "0.14.0",
"react-mixin": "3.0.0",
"react-native": "0.20.0",
"react-native-audioplayer": "0.2.0",
"react-native-background-geolocation": "0.3.3",
"react-native-code-push": "1.7.3-beta",
"react-native-file-upload": "1.0.4",
"react-native-image-picker": "marcshilling/react-native-image-picker#5720a18",
"react-native-mixpanel": "0.0.7",
"react-native-orientation": "JAStanton/react-native-orientation#340a0ba",
"react-native-scrollable-tab-view": "0.3.7",
"react-native-side-menu": "0.18.0",
"react-native-vector-icons": "1.2.1",
"react-timer-mixin": "0.13.3",
"redux": "3.3.1",
"redux-thunk": "1.0.3",
"shallowequal": "0.2.2",
"url": "0.11.0"
},
"devDependencies": {
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-preset-react-native": "1.4.0",
"babel-preset-stage-1": "6.5.0",
"babel-preset-stage-2": "6.5.0",
"babel-preset-stage-3": "6.5.0",
"code-push-cli": "1.5.0-beta",
"ios-sim": "5.0.6",
"mocha": "2.3.3",
"react-native-cli": "0.1.10",
"sinon": "1.17.1"
}
} I am on node-version: |
@JAStanton I already recommended @lifehackett and @sambarboza to replace es2015 by react-native preset and clear the cache, but seems they have the same problem still. P.S. You can remove stage-2 and stage-3 from your config, stage-1 includes 2nd and 3rd stages by default |
@jeffgran this is what I get when searching for
(everything else is either in "test" or "lint" folders, I'm guessing those don't count?) |
Huh. I don't know. My issue definitely seemed to be resolved when I figured out that multiple (incompatible) .babelrc files were being picked up. Maybe there are multiple causes of this issue. |
Interestingly, I came here because I started getting this error after installing my npm dependencies with yarn. Using npm works fine. Installing with yarn, and then running my React Native project results in this error. |
@hellogerard same. Tested yarn, it didn't install everything properly, went back to npm. Too new. |
When this will be fixed or fix will be shipped/merged? |
At this point this thread appears to be a number of unrelated issues globbed together with the original one fixed. I am going to close this issue and encourage people who still have something similar to open a new issue with repro steps that are specific to their app. Thanks folks! |
Summary: We started encountering the error described in #5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](#5747 (comment)) led to [this comment](#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes #11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
Summary: We started encountering the error described in facebook#5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](facebook#5747 (comment)) led to [this comment](facebook#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes facebook#11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
Summary: We started encountering the error described in facebook#5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](facebook#5747 (comment)) led to [this comment](facebook#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes facebook#11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
Summary: We started encountering the error described in facebook#5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](facebook#5747 (comment)) led to [this comment](facebook#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes facebook#11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
Summary: We started encountering the error described in facebook#5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](facebook#5747 (comment)) led to [this comment](facebook#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes facebook#11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
Summary: We started encountering the error described in #5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. [This comment](facebook/react-native#5747 (comment)) led to [this comment](facebook/react-native#4844 (comment)) which contains a solution we've been using successfully in our production app. Maybe I didn't look in the right place but it doesn't seem anyone had actually PR'd this change before (if so and I didn't find it, I apologize). An alternative solution it seems is to add a [different .babelrc](http://stackoverflow.com/questions/35563025/new-react-native-app-has-typeerror-babelhelpers-typeof-is-not-a-function-ios), but this seems easier to me. Closes facebook/react-native#11093 Differential Revision: D4353977 fbshipit-source-id: 3e45de29ef5d0e046219a32df6530dcf838b9fd9
@lacker I am having this exact issue. Log .babelrc
Deps
|
In my case, i forget to set presets in .babelrc, add "react-native" as preset in .babelrc works |
I just encountered this problem when adding the a dependency called redux-query. Changing the redux-query .babelrc from:
To:
Made problem go away. |
The project I inited before run normally. But the example cloned from react-native of github could not works. I followed the steps in README, and I find out one module require babel@5.8.29 when I run 'npm install'.
I assume that the error occurs because of the version of babel. But I can not solve the problem by install latest version of babel.
The text was updated successfully, but these errors were encountered: