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

Fix babelHelpers.typeof is not a function #11093

Closed
wants to merge 2 commits into from

Conversation

cmcewen
Copy link
Contributor

@cmcewen cmcewen commented Nov 23, 2016

We started encountering the error described in #5747 (`babelHelpers.typeof is not a function) after switching from npm to yarn. This comment led to this 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, but this seems easier to me.

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @yungsters to be a potential reviewer.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Nov 23, 2016
@SRandazzo
Copy link

For other who had this packager error: I was having this issue due to a symlinked module that has it's own .babelrc and is not transformed. The module's babelrc specifies "es2015", "react" presets which causes the packager to choke with the same typeof error

This PR change resolved the issue for me, would love to see this merged!

@crobinson42
Copy link

What does it take to get this PR merged?

@braco
Copy link

braco commented Dec 19, 2016

Thanks @cmcewen, this problem has been popping up all the time

@SRandazzo
Copy link

@cmcewen Anything we can do to help get this merged?

@cmcewen
Copy link
Contributor Author

cmcewen commented Dec 19, 2016

I'm not sure - looks like @janicduplessis did some work on this file a while back?

babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an obj !== Symbol.prototype comparison too? See https://github.com/babel/babel/blob/master/packages/babel-helpers/src/helpers.js#L8

@ide
Copy link
Contributor

ide commented Dec 20, 2016

@facebook-github-bot shipit

mikelambert pushed a commit to mikelambert/react-native that referenced this pull request Dec 24, 2016
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
nicktate pushed a commit to nicktate/react-native that referenced this pull request Dec 30, 2016
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
mikelambert pushed a commit to mikelambert/react-native that referenced this pull request Jan 4, 2017
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
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this pull request Jan 4, 2017
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
cpojer pushed a commit to facebook/metro that referenced this pull request Jan 26, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants