Hello! I am trying to call a server function in my fullstack desktop app (0.6 alpha 2 , cli and lib) but it just isnt being called:
I put a log info above and below the await call which both print but the server function (which has the print in it which i tried logging and println) never prints so its always coming back as Err and never Ok without even calling the server function
#Server Fn's not running
1 messages · Page 1 of 1 (latest)
I updated my component to this to prove it prints the CLICK and AFTER methods on the button press:
It seems the server itself is not starting, i am running dx serve in my UI directory though which seems to be running the server and desktop fine
Can you print the error
There isnt really an error:
I do get this though when I press o to open server mode, it opens localhost:8080 though which isnt the addr I set but that displays this:
https://discord.com/channels/899851952891002890/1288333949356998717
For reference purposes
I meant modifying this code to print the error from new_calender
Oh duh my bad, I'm getting this: Err(Request("builder error"))
searching source, cant find anything in dioxus soruce
The server function crate lives in the leptos repo
I haven't seen that error before
Nothing coming up in search sadly, would be nice if it was a little more descriptive 😭
maybe tied to this? Seems its still trying to bind to localhost:8080 though i set it to something else with my own axum router
Oh, if you set up your own custom router did you update the url your desktop app is calling server functions on?
The CLI server shouldn't interact with desktop outside of hot reloading
Aw shoot is that why
Cuz the fullstack-auth example didnt have it cuz they set up their own router so i didnt think you needed it
but i guess desktop you do? (i know that 1 liner youre talking about)
dioxus::fullstack::prelude::server_fn::client::set_server_url("http://127.0.0.1:8080");
Yeah, you don't need it on web becuase it is the current url
i almost hope this doesnt work cuz of how much time i spent trying to figurethis out 😭 🤣 shadoslow
Okay so it didnt work!
wth 🤣 , same builder error, same error on :8080 too
Definitely an issue with the server macro, removing alllows it to be called of course but that isnt a solution
dioxus::fullstack::prelude::server_fn::client::set_server_url("http://{ip}:{port}");
That string is not formatted. In rust strings are only formatted if they are in the format macro. (RSX applies the format macro to strings automatically)
You need dioxus::fullstack::prelude::server_fn::client::set_server_url(format!("http://{ip}:{port}"));
im actually stupid 😭
yeah i know rust well.... obviously i suck at remembering tho
i think i missed that cuz my editor grays out the featured out stuff that isnt enabled so i didnt have my colors 😭
Interesting though this function takes in a &'static str
thats extremely restrictive and wouldnt work in my case