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

Invalid State Error after bundling #16

Closed
yohanology opened this issue Apr 30, 2016 · 6 comments
Closed

Invalid State Error after bundling #16

yohanology opened this issue Apr 30, 2016 · 6 comments

Comments

@yohanology
Copy link

Hi,

I finished my React Native app very quickly, thanks to your awesome boilerplate! Now, I want to try it in production, so I uncommented jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; and loaded the app on my Iphone. I can see the SignIn screen but when I actually try to signin or signup, I got an error INVALID_STATE_ERR.

I got the ddp package you advised (https://www.npmjs.com/package/ddp), even tried to downgrade to 0.1.1, and use react native 0.24.1.

@spencercarli
Copy link
Owner

spencercarli commented Apr 30, 2016

A few things:

  • Try to use node-ddp-client instead (has a few fixes)
  • Make sure you add your production server url here and change env to prod or staging.

@yohanology
Copy link
Author

yohanology commented Apr 30, 2016

just for information, everything works absolutely fine in simulator, it's when I bundle the app on the device that the websocket connection somehow is not working and shows the error.

So I tried to change to node-ddp-client: I still got the error page on the device, and in the simulator I can connect through the signin page, but none of subscriptions are working.

And I didn't add the production server url in Appdelegate.m because I commented it and uncommented jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; to get the offline bundle...

I also tried many different config for the ddp connection (socketConstructor, ddpVersion...).

@yohanology
Copy link
Author

The problem comes from my meteor server (1.3 with imports/ directory structure)... Strangely, I can establish a connection to it through the simulator but not on the device. I tried with a meteor server (1.2 with old directory structure) and it's working fine...

How is that possible?

@shimza
Copy link

shimza commented May 1, 2016

I'm finding that 1.3 has caused many of my builds to fail; necessitating revising from scratch with the new directory structure.

Pain in the arse. Native with php is starting to look attractive again!!

Sent from my iPhone

On 1 May 2016, at 7:18 PM, Yohan Sihou notifications@github.com wrote:

The problem comes from my meteor server (1.3 with imports/ directory structure)... Strangely, I can establish a connection to it through the simulator but not on the device. I tried with a meteor server (1.2 with old directory structure) and it's working fine...

How is that possible?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@spencercarli
Copy link
Owner

Ah, yeah you're right about the Appdelegate.m - no need to change that url in this instance.

That's really strange that this isn't working in 1.3 but is in 1.2... are you getting an errors on the server? Can you connect to your remote/production server from the simulator (when it isn't bundled)?

Also what does your project architecture look like? If you have your react native app in your Meteor app's project structure it may be causing the issues.

@spencercarli
Copy link
Owner

If there were any issues related to the boilerplate they should be fixed in the latest major update. Please let me know if not. Thanks!

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

3 participants