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

Issue to update #183

Closed
txs opened this issue Dec 27, 2016 · 49 comments
Closed

Issue to update #183

txs opened this issue Dec 27, 2016 · 49 comments

Comments

@txs
Copy link

txs commented Dec 27, 2016

I'm having a issue about this.db.batchedUpdates is not a function inside WriteTransaction.js
And also _.all is not a function

Please help

@spencercarli
Copy link
Contributor

Possibly related:

I believe the issues comes from this line:

db.batchedUpdates = ReactNative.unstable_batchedUpdates;

RN source where it was defined: https://github.com/facebook/react-native/blob/3683beb88ab3233038ac32b9c33112d537478088/Libraries/Renderer/src/renderers/native/ReactNative.js#L41

@txs what version of React Native are you using? I wonder if ReactNative.unstable_batchedUpdates is no longer valid.

@Mokto I checked out the git blame and looks like you made that change - any insight on this?

@txs
Copy link
Author

txs commented Dec 28, 2016

RN 0.39.2

@txs
Copy link
Author

txs commented Dec 28, 2016

I'm using the ws not wss

@txs
Copy link
Author

txs commented Dec 28, 2016

the line is in WriteTransaction.js "return this.db.batchedUpdates((function(_this) {" line 75

@txs
Copy link
Author

txs commented Jan 28, 2017

@spencercarli Do you know how to solve it?

@spencercarli
Copy link
Contributor

@txs no sorry I don't. I'm using the latest React Native and latest version of this packages without any issues.

@txs
Copy link
Author

txs commented Apr 18, 2017

I still have this issue and the batchupdate seems deprecated

@turbobuilt
Copy link

I'm having this issue in .45.0-rc.0. When I downrgrade to .44 it goes away

@txs
Copy link
Author

txs commented May 13, 2017

I think it's a issue with minimongo 0.48

@txs
Copy link
Author

txs commented May 13, 2017

I'm using react native 0.42, I'll try upgrade to 0.44

@txs
Copy link
Author

txs commented May 13, 2017

I think we have to change it to unstable_batchedUpdate

@txs
Copy link
Author

txs commented May 15, 2017 via email

@turbobuilt
Copy link

Hey @txs, I don't have a lot of extra time right now so I'm going to wait to test till .45 comes out of rc because it makes upgrading quicker. Thanks for the tip though.

@anhtuank7c
Copy link

0.45.0 is now official and still got this error :(

@txs
Copy link
Author

txs commented Jun 8, 2017 via email

@anhtuank7c
Copy link

anhtuank7c commented Jun 8, 2017

@txs I use React Native.

	"dependencies": {
		"react": "16.0.0-alpha.12",
		"react-native": "0.45.0"
        }

screen shot 2017-06-08 at 5 04 37 pm

@steven-tib
Copy link

I'm having the same issue,
I just tried to update to 0.45 and also have react 16 alpha dependency
Anyone found a way to fix it with 0.45 or should I downgrade to 0.44?

@anhtuank7c
Copy link

@steven-tib
I have to use RN 44 instead of 45.

@steven-tib
Copy link

@anhtuank7c thanks, I'll switch back to 0.44 then

@Nauzer
Copy link
Contributor

Nauzer commented Jun 9, 2017

I'm having the same issue. Downgrading to 0.44 has helped.
Is this an issue of React-Native or with this package?

Edit issue in mini-mongo-cache package

@wenzelmkay
Copy link

I'm having the same problem, and I'm having trouble figuring out how to downgrade to 0.44. Could anyone point me in the direction of some instructions on how to downgrade?

@Nauzer
Copy link
Contributor

Nauzer commented Jun 12, 2017

I think you can just remove your node_modules folder, update the version in your package.json and run npm install.

Sent from my OnePlus ONEPLUS A3003 using FastHub

@Nauzer
Copy link
Contributor

Nauzer commented Jun 13, 2017

@steven-tib to avoid staying stuck on 0.44, I was looking into fixing this.
Haven't gotten a lot further though. How about you?

@Nauzer
Copy link
Contributor

Nauzer commented Jun 13, 2017

I was able to get it to work by using ReactDOM. Which is ofcourse not a real solution. Shouldn't need ReactDOM dependency in a react-native project. Anyway sharing it here to get people going until a more structural solution is found.

@txs @spencercarli @Mokto @dtruel Any ideas?

Data.js:

// line 
import ReactDOM from 'react-dom';
...
// line 9 change to:
db.batchedUpdates = ReactDOM.unstable_batchedUpdates;

Make sure to add ReactDOM to your project dependencies.

A working branch can be found here:
Nauzer@4c18bbe

EDIT: I opened an issue in the ReactNative repo as the error is caused by ReactNative no longer exposing unstable_batchedUpdates method.

@steven-tib
Copy link

@Nauzer I haven't checked this further sorry, just downgraded for now. Thanks for trying to fix it though

@spencercarli
Copy link
Contributor

Been working on this all morning. Having trouble upgrading to 0.45 - my app crashes whenever I turn remote debugging on 🙄

@Nauzer
Copy link
Contributor

Nauzer commented Jun 13, 2017

@spencercarli same here.
All I could do was use ReactDOM to replace it as a hack... Let's hope someone at FB looks at the react-native issue I posted.

For your issue --> Had this same issue. Here's helped for me:

  • remove node_modules
  • npm install
  • clear build in xcodeproject/workspace (Shift + Cmd + K)
  • clear build folder in xcodeproject/workspace (Alt + Shift + Cmd + K)
  • react-native run-ios

Also upgrading to 0.45.1 made everything a lot better in terms of build stability. Doesn't solve the issue though.

@steven-tib Downgrade doesn't do for me because of some issue with react-native-maps. Let's see.

@spencercarli
Copy link
Contributor

@Nauzer the issue I had (I think) was related to react-native-maps. I was on 0.43 then upgraded to 0.44, maps didn't work so I unlinked and relinked react-native-maps which fixed everything in 0.44, then went to 0.45. Now batchedUpdates 😄

react-dom crashes my app for some reason. Hopefully I can figure it out!

@Nauzer
Copy link
Contributor

Nauzer commented Jun 13, 2017

What kind of error are you getting? I included [email protected] as a dependency of my react-native-meteor fork not directly in my project.

BTW, what your experience on RN. Is it always such a pain in the ... or is it just a unlucky moment for me to step in? ;-)

Sent from my OnePlus ONEPLUS A3003 using FastHub

@spencercarli
Copy link
Contributor

@Nauzer I was (stupidly) using the wrong version of react-dom - completely neglected to see your working branch the branch you linked to! Thanks for providing that!

You just stepped in at a lucky time 😄 - this issue just started hitting most people (except OP) in the last few days with the release of RN v0.45 (my email has been inundated with questions about it)

Other than that there haven't been many issues (at least from my experience)

@edmundkwok
Copy link

Looks like 'ReactNativeInternals' (which exported unstable_batchedUpdates) was removed from being exposed as per:

facebook/react-native@f3dbddc#diff-834d77988fd4294e13e3e35533b3e248L161

While waiting for an update on facebook/react-native#14490, I did the following change in react-native-meteor to import ReactNativeInternals directly:

Data.js

// Line 1
- import ReactNative from 'react-native';
+ const ReactNative = require('react-native/Libraries/Renderer/src/renderers/native/ReactNative');

Seems like it's working, but may not be the best long term fix.

What do you guys think?

@Nauzer
Copy link
Contributor

Nauzer commented Jun 14, 2017

Thanks @edmundkwok I was on this trail yesterday by using ReactNativeStack/ReactNativeFiber - didn't get it to work. Good job!
One thing - I would suggest sticking to ES6 imports.

Data.js:

// line 1
- import ReactNative from 'react-native';
+import ReactNative from 'react-native/Libraries/Renderer/src/renderers/native/ReactNative'

Maybe you want to post your solution to the RN Issue to add some context?

@edmundkwok
Copy link

edmundkwok commented Jun 14, 2017

Thanks @Nauzer! Yes, of course, we should stick to ES6 😉

I have added a comment on facebook/react-native#14490

@wenzelmkay
Copy link

wenzelmkay commented Jun 15, 2017

@Nauzer Thanks for your previous help! I have a question that might be kind of dumb, but where should I be adding the change recommended by @edmundkwok to? (I'm very new to coding + react-native in general).

@Nauzer
Copy link
Contributor

Nauzer commented Jun 15, 2017

Hi @wenzelmk
Until we merge this in this repo somehow (for that we need to confirm the issue in the react-native repo link to above) you can use my branch.

git clone https://github.com/Nauzer/react-native-meteor.git
in a directory of your liking.

In your project's package.json replace react-native-meteor with the relative path to the directory where you cloned it. I did it in my project's parent folder.

-"react-native-meteor": "^1.0.3",
+"react-native-meteor": "../react-native-meteor"

remove the node_modules folder

npm install

And you should be good to go :)

@abser
Copy link

abser commented Jun 16, 2017

Thanks @Nauzer .
It helps me as well.

@ujwal-setlur
Copy link
Contributor

Just ran into this as well. Downgrading to 0.44. Hopefully, I won't run into any issues on that path.

@ujwal-setlur
Copy link
Contributor

OK, downgrading to RN 0.44 worked for me. Hopefully, this will get resolved soon.

Nauzer added a commit to Nauzer/react-native-meteor that referenced this issue Jun 20, 2017
@Nauzer
Copy link
Contributor

Nauzer commented Jun 20, 2017

I could do a PR for this.
Automatic tests are failing but that is not a result of the change for this fix.

@noris666 Any suggestions?

@elie222
Copy link

elie222 commented Jun 23, 2017

Or this: "react-native-meteor": "git://github.com/Nauzer/react-native-meteor.git",

@jasonnathan
Copy link

@Nauzer, I tried using your branch and I'm getting another error, this time for loginWithPassword. (I could start a new issue, but not sure if it's related & issues are disabled on your branch)

ExceptionsManager.js:63 _reactNativeMeteor2.default.loginWithPassword(...) is not a function

Nauzer added a commit that referenced this issue Jul 2, 2017
Switch to 'prop-types' instead of React.PropTypes
Fix error 'db.batchUpdates undefined is not a function'. Issue #183
@Nauzer
Copy link
Contributor

Nauzer commented Jul 2, 2017

@jasonnathan i cant reproduce. Can you share your code?

Sent from my OnePlus ONEPLUS A3003 using FastHub

@ujwal-setlur
Copy link
Contributor

ujwal-setlur commented Jul 2, 2017 via email

@jasonnathan
Copy link

Apologies @Nauzer, false alarm!

@Nauzer
Copy link
Contributor

Nauzer commented Jul 3, 2017

@ujwal-setlur It was already nerged. Will be pushed to npm somewhere today.

Sent from my OnePlus ONEPLUS A3003 using FastHub

@ujwal-setlur
Copy link
Contributor

ujwal-setlur commented Jul 3, 2017 via email

@Nauzer
Copy link
Contributor

Nauzer commented Jul 4, 2017

Merged to version 1.0.5. Closed.

Sent from my OnePlus ONEPLUS A3003 using FastHub

@Nauzer Nauzer closed this as completed Jul 4, 2017
@ujwal-setlur
Copy link
Contributor

ujwal-setlur commented Jul 4, 2017 via email

@charpeni
Copy link
Collaborator

charpeni commented Jul 6, 2017

@Nauzer in [email protected], it has been renamed. 😓

-import ReactNative from 'react-native/Libraries/Renderer/src/renderers/native/ReactNative';
+import ReactNative from 'react-native/Libraries/Renderer/shims/ReactNative';

I'll send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests