react-native icon indicating copy to clipboard operation
react-native copied to clipboard

SyntaxError: Left hand side of operator '=' must be a reference.

Open madwed opened this issue 10 years ago • 38 comments

Im running into SyntaxError: Left hand side of operator '=' must be a reference. when I initialize a new 0.17 project. In the Android avd emulator it specifies (line 2928 in the generated bundle) which is:

this._debugInfo[this._callbackID>>5]=null;

In the iOS emulator the error looks like:

simulator screen shot jan 6 2016 4 37 52 pm

I've tried uninstalling node_modules, restarting the packager, but no luck.

madwed avatar Jan 06 '16 21:01 madwed

Hey madwed, 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 something is not working as you expect but not sure it's 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!

facebook-github-bot avatar Jan 06 '16 21:01 facebook-github-bot

I am seeing the same issue for both a newly initialized project as well as for an existing (and working) project. In this case the Movie List Tutorial. Like @madwed I was using v0.17.0. I noticed there was a new react-native build released earlier today so I installed v0.18.0-rc in case there were inconsistencies with other react-native services. I was sure to run:

 react-native upgrade

on both projects. There was nothing to upgrade on the newly init'ed project, but the schema was upgraded for the existing project.

conflict ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme
? Overwrite ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme? overwrite
    force ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme

This did not fix my issue. I am running a stock Nexus 5 emulator with Marshmallow and an iPhone 5s emulator. I will try to push to a device to see if the problem is isolated to emulators.

I hope this is a temporary issue with the new release because it seems to cripple the whole dev environment.

awaidmann avatar Jan 06 '16 22:01 awaidmann

I'm getting the same issue. I haven't changed a thing in the project after running react-native init.

I don't have more information to add than @awaidmann, but this is immediately after installing everything. So everything I have is the latest version in the install process.

cwramsey avatar Jan 06 '16 22:01 cwramsey

I'm getting the same issue. I had react-native 0.16 and it worked fine.

I deleted the node_module and npm install again (still 0.16)

now i get the SyntaxError: Left hand side of operator '=' must be a reference. error

JakeRawr avatar Jan 06 '16 22:01 JakeRawr

Update: I am able to run the existing app on my HTC One (Android: 5.0.2, HTC Sense: 6.0), but for some reason the newly init'ed project is still having issues. I am now getting the error log: screenshot_2016-01-06-14-23-36

I assume the two issues are related, but I am not familiar enough with react-native to know how or why.

awaidmann avatar Jan 06 '16 22:01 awaidmann

Was just helping an engineer on my team get our react-native project set up, and he's running into the same issue. I upgraded to 0.17 yesterday and did not run into any trouble.

aflanagan avatar Jan 06 '16 22:01 aflanagan

+1 on this. Running android 0.17. An open source project that compiled and ran cleanly yesterday does not work all of a sudden.

sampurcell93 avatar Jan 06 '16 23:01 sampurcell93

Since this issue is just popping up now, I wonder if something changed with Babel upstream...

ide avatar Jan 06 '16 23:01 ide

I think this is due to a new babel release (6.4.0) which has breaking changes

ben-manes avatar Jan 06 '16 23:01 ben-manes

I think this is the upstream bug: https://phabricator.babeljs.io/T6926

sneuberger avatar Jan 06 '16 23:01 sneuberger

@sneuberger thanks for digging that up.

ide avatar Jan 06 '16 23:01 ide

Same here, tried 0.17 and 0.18.0-rc but result is the same.

jmrodriguez-medallia avatar Jan 07 '16 00:01 jmrodriguez-medallia

Babel just published a hotfix -- skevy is testing to see if it resolves the RN issue.

ide avatar Jan 07 '16 00:01 ide

Hey y'all - can you all try again? Just re-npm install. It should pull the latest version of 6.4.1

skevy avatar Jan 07 '16 00:01 skevy

(You'll probably need to delete node_modules, just to be safe)

skevy avatar Jan 07 '16 00:01 skevy

works for me, thanks!

ben-manes avatar Jan 07 '16 00:01 ben-manes

Awesome, thanks for the confirmation @skevy & @ben-manes. Going to be optimistic here and am closing this out.

How to fix this:

  1. Clear your npm cache: npm cache clean
  2. Clear your node_modules: rm -rf node_modules
  3. Install your node_modules again: npm install

ide avatar Jan 07 '16 00:01 ide

FYI - Not getting the 6.4.1 when I blow away node_modules and re npm install. Still pulling [email protected]

steakchaser avatar Jan 07 '16 00:01 steakchaser

@steakchaser that's weird, but could you try running npm cache clean?

ide avatar Jan 07 '16 00:01 ide

Yeah, when I follow those steps I'm still getting 6.4.0. When I run npm info babel-core the last entry in the versions array says 6.4.0, and not 6.4.1 like I would expect. npm cache clean doesn't fix it for me either.

jasonmerino avatar Jan 07 '16 00:01 jasonmerino