Lexicon Version 1: Unable to connect to the Lexicon app #35
-
Hi, I have been trying to follow your docs to configure the prose instances for lexicon and discourse API but I'm unable to do so. I have tried several different combinations that I think were suitable for MOBILE_PROSE_HOST and MOBILE_PROSE_PORT. I even added the values http://localhost and 8999 respectively, but it keeps showing me the error 'Please connect to a network.' Please help me fix this issue. |
Beta Was this translation helpful? Give feedback.
Replies: 25 comments
-
I don't think this project is still being actively worked on. |
Beta Was this translation helpful? Give feedback.
-
Yeah, it's been months now. But they have instructed on how to configure, I did exactly the same still I am facing this issue. |
Beta Was this translation helpful? Give feedback.
-
I wish they would explain why they've disappeared... |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. After pointing to my discourse site, it keeps loading the default which is "meta.discourse.org" and sometimes tells me to connect to a network. Any help?? |
Beta Was this translation helpful? Give feedback.
-
@muninderkaur06 in
From their documentation:
Also, especially this part:
|
Beta Was this translation helpful? Give feedback.
-
@akinseye21 could you share more about your setup?
Here is an example setup that points at https://users.rust-lang.org: api/.env
frontend/.env
Note api Output
frontend
|
Beta Was this translation helpful? Give feedback.
-
Thanks for posting this, this is a good way to help others debug and is very appreciated. |
Beta Was this translation helpful? Give feedback.
-
Coming up next:
|
Beta Was this translation helpful? Give feedback.
-
On this particular issue, since it seems to have caused some confusion, I have also updated the defaults in Prose. This will cause Prose to listen on In this scenario, it is of course required that your laptop and mobile device are on the same network and can reach each other. I will leave this issue open for another week or so to catch anyone who is still running into issues here, and then it will be closed. |
Beta Was this translation helpful? Give feedback.
-
Hi people, What I did was I found out that IP address and giving full permissions to nodeJs are the most important thing here. I figured out, whenever the system IP address changes the app doesn't work. To fix this, I have to a statically fix my IP address to the one my system is assigned during lexicon setup procedure. (For IPV4 in adapter settings.) |
Beta Was this translation helpful? Give feedback.
-
Let me mention, For frontend folder in .env file: MOBILE_PROSE_HOST=http://192.168.1.3 (Your system IPV4 address) For api folder in .env file: PROSE_DISCOURSE_HOST=(meta discourse website) These values worked for me. |
Beta Was this translation helpful? Give feedback.
-
Hello, Glad you were able to get it working. We do cover this part about finding your local IP address the Development Setup section of the documentation. However, if you're just running Expo on your mobile device, and your development machine is on the same network, much of the config you posted shouldn't be necessary. By the way, Importantly, if you set You can read more about how we determine i.e. I was just able to get everything up and running with this only this config:
Shell$ git clone [email protected]:lexiconhq/lexicon.git lexicon-test
$ cd lexicon-test
$ yarn
$ yarn generate # Don't forget to run yarn generate when first cloning!
$ echo "PROSE_DISCOURSE_HOST=https://users.rust-lang.org" > api/.env
$ echo "MOBILE_PROSE_HOST=http://localhost" > frontend/.env
$ yarn --cwd api start & # API launched as a background process, or just do it in a separate shell
Attempting to reach your Discourse instance at https://users.rust-lang.org...
Your Discourse instance was reachable and valid.
-- Prose GraphQL Discourse API --
listening at http://0.0.0.0:80
forwarding Discourse requests to https://users.rust-lang.org
$ cd frontend
$ yarn start
Starting project at lexicon-test/frontend
Starting Metro Bundler
...
› Metro waiting on exp://192.168.0.53:19000
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
...
Logs for your project will appear below. Press Ctrl+C to exit.
Started Metro Bundler
|
Beta Was this translation helpful? Give feedback.
-
For anyone interested, you can see how we're determining the local IP address of your development machine from within the React Native app here: src/frontend/constants/app.ts // ...
// Only if we're not in production, and we're attempting to connect our local machine
// (localhost or 127.0.0.1), extract the debuggerHost if possible and use that instead.
// This allows the Android Emulator, as well as your own device on the same network, to
// access your local machine to connect to a locally running Prose instance.
const { debuggerHost } = manifest ?? {};
if (!debuggerHost) {
return defaultValue;
}
// Example `debuggerHost`: 192.168.0.53:19000
const machineHost = debuggerHost.split(':')[0];
if (!machineHost) {
return defaultValue;
}
return `http://${machineHost}${delimitedProsePort}`;
}
// ... |
Beta Was this translation helpful? Give feedback.
-
@Kinostrome It's how my app is been working with these values in .env file. Please do mention somewhere that the IP address needs to be same. If today I'm doing the lexicon setup and my IP address is suppose http://192.168.1.3, it may work today. |
Beta Was this translation helpful? Give feedback.
-
And I have just taken the time to explain to you why you don't need all of those values. It will work without them. And I don't want other users to see your example and think they have to do all of that to make it work—hence the correction.
Yes, please read what I wrote again. We have already set it up so you don't have to deal with this. This is exactly the reason that I said:
You do not need to manually set your IP address if you set |
Beta Was this translation helpful? Give feedback.
-
Thank you, I will try this and revert |
Beta Was this translation helpful? Give feedback.
-
Great, let us know how it goes. Some tips:
|
Beta Was this translation helpful? Give feedback.
-
Hello guys!! this worked well for me. Thank you. One last thing, I am having issues building the apk file of the app. Any help? |
Beta Was this translation helpful? Give feedback.
-
Really glad to hear that. Did you run the command outlined in Publishing to the Play Store? After setting up the required Expo configuration.
If so, what kind of error messages are you seeing? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the help, it built successfully. I was initiating the command from the root folder rather than the frontend/ |
Beta Was this translation helpful? Give feedback.
-
My build not working appropriately. Does my mobile device have to be on the same network with my computer for it to function? |
Beta Was this translation helpful? Give feedback.
-
Please provide proper detailsUnfortunately that is not enough detail for us to help you. "not working appropriately" doesn't tell us anything about what could be going wrong. What is happening? What are you expecting to happen? Post console output, screenshots, videos, etc. You will need to describe how specifically the build is not working appropriately. Otherwise there's not much more to be said here. |
Beta Was this translation helpful? Give feedback.
-
The app shows an error message "Please connect to a network" when I try to login |
Beta Was this translation helpful? Give feedback.
-
Please try to provide more detail with these issue reports.. this doesn't tell us the important details like:
If you're trying to publish your app to the App Store / Play Store, then you need to think about how your users are going to access your Prose server—meaning you'll need to deploy it somewhere. After all, they wouldn't download the app to have it connect to the server running on your local computer, would they? Supposing you wanted to deploy it to:
Then your
And your
With those values set, then you would build your app. To get a proper understanding, you should read through the documentation about how to deploy the Prose GraphQL API here: https://docs.lexicon.is/dedicated |
Beta Was this translation helpful? Give feedback.
-
Closing this issue. If anyone has further problems setting things up, please open a new issue. |
Beta Was this translation helpful? Give feedback.
Please try to provide more detail with these issue reports.. this doesn't tell us the important details like:
If you're trying to publish your app to the App Store / Play Store, then you need to think about how your users are going to access your Prose server—meaning you'll need to deploy it somewhere. After all, they wouldn't download the app to have it connect to the server running on your local computer, would they?
Supposing you wanted to deploy it to: