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

Cannot fetch with relative paths #1985

Closed
1 of 3 tasks
SOF3 opened this issue Aug 3, 2021 · 4 comments
Closed
1 of 3 tasks

Cannot fetch with relative paths #1985

SOF3 opened this issue Aug 3, 2021 · 4 comments
Labels
A-yew Area: The main yew crate bug

Comments

@SOF3
Copy link
Contributor

SOF3 commented Aug 3, 2021

Problem

fetch::Request cannot be constructed to write relative paths.

Steps To Reproduce
Steps to reproduce the behavior:

Call yew::services::fetch::Request::get("foo/bar")

Actual behaviour
Returns error: http::Error(InvalidUri(InvalidFormat))

Expected behavior
Construct a request that fetches ./foo/bar

Environment:

  • Yew version: v0.18.0
  • Rust version: nightly-2021-08-01
  • Target, if relevant: wasm32-unknown-unknown
  • Build tool, if relevant: trunk
  • OS, if relevant: linux ubuntu
  • Browser and version, if relevant: firefox 90.0

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@SOF3 SOF3 added the bug label Aug 3, 2021
@ranile
Copy link
Member

ranile commented Aug 3, 2021

Fetch service has been removed on master and this change will be a part of the next release. Please consider using something else like reqwasm, reqwest, etc

@SOF3
Copy link
Contributor Author

SOF3 commented Aug 3, 2021

Why is it being removed? It is not exactly trivial to integrate async logic with yew's callback mechanism.

@mc1098
Copy link
Contributor

mc1098 commented Aug 3, 2021

callback now supports send_future function to help with this :)
You can see how this works in the futures example

edit: by "now" I mean in master and would be in the next release (v0.19.0) :)

@mc1098 mc1098 added the A-yew Area: The main yew crate label Sep 20, 2021
@ranile
Copy link
Member

ranile commented Dec 14, 2021

yew 0.19 has been released which removes services altogether. It is now recommended to use another library like reqwasm for fetch.

@ranile ranile closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew Area: The main yew crate bug
Projects
None yet
Development

No branches or pull requests

3 participants