-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Tutorial proxy-backend returning index.html
not json?
#3562
Comments
Same issue here |
I just ran |
Same issue.
with this code, I ran
but curl returns fine.
|
In my case, it turns out browser issue. chrome Console returns
I don't know what that means exactly, but I guess it cannot get data.json correctly and leads 'serde error'. Safari, Firefox, Edge work fine. |
Had the same issue on mac m1 pro, Sonoma 14.3 with 5000 port, swithed to 8000 port and it started working pretty well. So the next step was turn 5000 back, so it continued working well. I think it is may be because of some cache issues because i noticed that first request was a bit longer then next. |
Thank you @mDanone, changing ports helped. |
The problem I had here, for Firefox at least, is that once the client gets a CORS error Firefox won't allow the request to be retried once the proxy server is up. Even shift-reload doesn't seem to reset things. Easy workaround is to just connect again in a new tab. Is there some reason |
I'm having the exact same problem (Firefox) - the download isn't
Yet, As per the tutorial, I'm running: And my fetch code is:
I feel like I'm doing something obviously wrong, but I can't work out what! Note: opening in a new tab doesn't help, neither does forced refresh, or restarting Interestingly, if I run |
Seems to be indeed a caching issue. Had the same issue in Firefox, first run the Request directly with the CORS issue and after running it with |
Note: I think I followed the tuto right, but it may well be a user error - what really happens behind my back in
trunk serve --proxy-backend
indeed worries me.Problem
In the last step of the tutorial, the
trunk serve
process does report proxying as expected:but the call to
json()
on theResponse
object fails with a parse error, caught byunwrap()
:When querying its
text()
instead I get something looking likedist/index.html
, excep:{{__TRUNK_ADDRESS__}}
expanded56dc19c1d...
hash in them, whereas the one indist
changes on every rebuildwhen my
index.html
reads:curl http://127.0.0.1:8080/tutorial/data.json
does dump me the expected JSON (and I also tried to add an intermediate tutorial step just for decoding, see repo, but I'm not pleased with how it diverges too much to be useful)Steps To Reproduce
I uploaded my steps to https://github.com/ydirson/test-yew-tutorial
Steps to reproduce the behavior:
.json().unwrap()
failDBG
to see thetext()
dumpEnvironment:
wasm32-unknown-unknown
trunk
Questionnaire
The text was updated successfully, but these errors were encountered: