-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Gradio app not working inside Next.js #2880
Comments
Any help here would be appreciated. cc: @abidlabs |
For context this is happening when i'm using the gradio webcomponent in Next.js |
Hi, I have the same problem with a Gradio app hosted on HF and embedded using Web components. The app works fine on the HF Space, works when embedded using an iframe, and doesn't work when embedded using Web components. As @krrishdholakia said, also in my case there's a GET call to |
Thanks for creating the issue folks. We'll look into it! cc @aliabid94 |
Having same issue when using html tag. Happening on all gradio versions I try. |
Is this still present? I can't reproduce it. https://2880-gradio-next-pngwn.vercel.app/ https://github.com/pngwn/2880-gradio-next There is a problem in dev mode however, that I have a fix for in #3065. |
All my embeds are still broken when using tag. Iframe works. Frustrating! |
Can i see some code please? |
Hi! The problem is still present for me too. The HF space I'm trying to embed: https://huggingface.co/spaces/fabiochiu/sentiment-analysis-demo/blob/main/app.py
The embedded app raises an error after trying to call the model hosted on HF. |
I tried using your space and it works fine for me: https://2880-gradio-next.vercel.app/ Can you show the whole file please, or the whole project if it is public? |
Oh the embedding is slightly different here, let me check that. |
Ok! Let me know if having a public page can help you, I can set it up quickly |
The demo you linked doesn't work for me and produces the error. |
Yeah sorry, I changed it again. I'm now able to reproduce the error. The reason is basically that we have a number of different ways to link to a space in order to embed a gradio app on a page (too many ways really). There was some logic that incorrectly utilising the URL of the embedding page for certain requests (only when using the I've fixed this in #3065 now and it should go out soon. In the meantime if you use the <gradio-app
space="fabiochiu/sentiment-analysis-demo"
></gradio-app> Or you can use the <gradio-app
host="fabiochiu-sentiment-analysis-demo.hf.space"
></gradio-app> We have So for now use one of the other methods, the fix for this will be in soon, and we will need to clean up the API for this in the future. I think we can just have one attribute that figures things out rather than 3. Thanks for your help with this one, was sneaky! |
That solved it for me, thank you very much! |
Describe the bug
Hi,
I'm embedding my Gradio app inside Next.js.
When I do this, while the component loads - it is not functional.
This is the error thrown in console log:
WebSocket connection to 'wss://nextmagictemplateappv2.krrishdholakia.repl.co/queue/join' failed:
I'm not sure why it would be making a queue/join request to my next.js app, when the gradio app is hosted on hf and just being wrapped by the next.js app.
Any help here would be appreciated.
Is there an existing issue for this?
Reproduction
https://nextmagictemplateappv2.krrishdholakia.repl.co/
Screenshot
No response
Logs
index.4ac6a7e7.js:34 WebSocket connection to 'wss://nextmagictemplateappv2.krrishdholakia.repl.co/queue/join' failed: (anonymous) @ index.4ac6a7e7.js:34 (anonymous) @ index.4ac6a7e7.js:76 (anonymous) @ index.4ac6a7e7.js:4 ie @ index.4ac6a7e7.js:4 P @ index.4ac6a7e7.js:77 (anonymous) @ index.4ac6a7e7.js:4 (anonymous) @ index.4ac6a7e7.js:4 h @ index.4ac6a7e7.js:76
System Info
src="https://gradio.s3-us-west-2.amazonaws.com/3.12.0/gradio.js"
Severity
blocking all usage of gradio
The text was updated successfully, but these errors were encountered: