-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bundled fullstack desktop apps don't work (Linux, Windows) #3689
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
Comments
#3693 should fix the CLI issue that was causing two server builds to be bundled instead of a server and desktop build.
You need to set the production url of your server in your main.rs so it doesn't try to connect to localhost: // Set the url of the server where server functions are hosted.
#[cfg(not(feature = "server"))]
dioxus::fullstack::prelude::server_fn::client::set_server_url("http://yourserverlocation"); ^ That snippet is taken from the fullstack desktop example |
Okay, I added this line, copied from the example:
This is a small step forward. Now, the echo server function works via But I don't want to use port 8080 all the time---how could I ever have more than one instance of my app? And in production (bundles), I want to choose a random free port and not worry about it at all, of course. How would I set up this? Server functions don't work when the app is run through a bundled AppImage. Typing something to echo results in
|
After you bundle the app with the CLI from #3693, you need to run both the server bundle and the desktop app seperately. The CLI should print the location of both near the end of the logs. If you want to change the port or IP the server is hosted on, you can set the |
So I will have to wait for a new release then? Will I still be able to simply say I noticed there is some default setup in Dioxus' PORT and IP variables are confusing. On |
#3701 fixes serving with
You will always need to set the server url manually with |
On android setting the production url results in Deserialization error, and setting it to just http://127.0.0.1:8080 with emulator results in:
as well. |
What do you mean with "production build"---a bundled app I create with |
@phkoester not sure if it's still relevant, but I faced similar issue when trying to create just a simple desktop application. Eventually, my understanding is that a simple desktop app is not fullstack, it's just desktop. the full stack is for case when you want a server and client apps connecting to it. At least that's my understanding but I'm just starting with this. |
@yanshay - Should we be using a different term (other than "fullstack") for a desktop or mobile binary that has a backend (for instance, creating it's own sqlite db on the desktop/mobile device to persist structured data) but where that backend isn't managed by a separate server binary? I'm looking at the example desktop projects like the file explorer but none of them store their own structured data. |
I'm not sure if the terminology is critical, I think the documentation of what each term mean and possible combinations should be clearer. Even now searching for such one page on that I can't find such. It assumes everyone knows what each term means, and the architecture, but I for example thought that the Desktop is just a browser in a desktop app, and need the full-stack part to gain access to the file system. This is how I think of these: There's Web vs. Desktop, and then there's FullStack option which is an add-on to either. And while Web doesn't have access to any machine resources, Desktop has full access to the machine it's running on. FullStack is the add-on for having a built-in communication channel + server code + maybe more (ssg), interleaved with client code - from either Web or Desktop to another server. So I think a document, very early in the documentation on the high level architecture and the terms is in place. |
Problem
I simply create a fullstack app with
dx new
, bundle it withdx bundle --platform desktop
on Linux and Windows. Neither the Linux AppImage nor Windows MSI nor Windows Setup work.Steps To Reproduce
Steps to reproduce the behavior:
dx new some_app
, choose fullstack.dx bundle --platform desktop
(Linux, Windows)Expected behavior
Actual behavior:
(Sorry, my Windows is German, but
AddrInUse
should be clear.)Environment:
desktop
There is probably a lot I can configure in
Dioxus.toml
, but the documentation is somewhat scattered, thebundle
sections are unclear to me, also I'm not sure how to write mymain
function properly. Currently it looks like this, I'm still toying around:The text was updated successfully, but these errors were encountered: