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

"dx new" with fullstack, test: ServerFn Echo panics #3674

Closed
ealmloff opened this issue Jan 30, 2025 · 6 comments · Fixed by #3701
Closed

"dx new" with fullstack, test: ServerFn Echo panics #3674

ealmloff opened this issue Jan 30, 2025 · 6 comments · Fixed by #3701
Assignees
Labels
bug Something isn't working desktop Suggestions related to the desktop renderer fullstack related to the fullstack crate

Comments

@ealmloff
Copy link
Member

Discussed in #3673

Originally posted by phkoester January 30, 2025
Hello,

I'm totally new to Dioxus and am playing around with dx new. I noticed when I choose the fullstack option and launch my desktop app with dx serve --platform desktop, the echo server function doesn't work. I get the error

16:37:40 [linux] thread 'main' panicked at src/components/echo.rs:18:65:
16:37:40 [linux] called `Result::unwrap()` on an `Err` value: Request("error sending request for url (http://127.0.0.1:43405/api/echo_server9820224038553403100)")

followed by a long stack trace. dx says "ServerFns at: http://127.0.0.1:8080". Is this a problem with the port?

When I run dx run --platform desktop, the echo demo works fine. But now I miss hot reloading, of course.

Steps to reproduce:

  • use Dioxus CLI 0.6.2
  • dx new some_app, choose fullstack
  • Run the app with dx serve --platform desktop
  • Type something below "ServerFn Echo"
  • -> App panics
@ealmloff ealmloff added bug Something isn't working desktop Suggestions related to the desktop renderer fullstack related to the fullstack crate labels Jan 30, 2025
@h4ck4l1
Copy link

h4ck4l1 commented Feb 2, 2025

Hey did you find any work around? and by the way are you using wsl?

@ealmloff
Copy link
Member Author

ealmloff commented Feb 3, 2025

Hey did you find any work around? and by the way are you using wsl?

For production builds you will always need to set the server url manually like the fullstack desktop example does here

@ealmloff ealmloff self-assigned this Feb 3, 2025
@patrik-cihal
Copy link

Can confirm this happens on android as well and not just with a new project.

@patrik-cihal
Copy link

Also this: dioxus::fullstack::prelude::server_fn::client::set_server_url("http://127.0.0.1:8080"); didn't fix the issue for me.

@rgunindi
Copy link

rgunindi commented Feb 5, 2025

It also didn't work for me with the real server URL.

@patrik-cihal
Copy link

A potential clue not sure it will help.... Old project with android and server functions still seems to be working and it seems to be independent of dioxus version being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop Suggestions related to the desktop renderer fullstack related to the fullstack crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants