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
Custom Components: gradio cc build - js not being built #6925
Comments
Well, I found the cause of the issue. In this part of the Gradio code of venv\Lib\site-packages\gradio\node\examine.py:
the code just stops after the importlib line (or is not handled by the javascript that calls it). I put it in a try block and got a After doing a Not sure what the initial thing that causes this is though. |
Hi @freddyaboulton , Have you tried uninstalling the custom component and then trying a gradio cc build? Mine got (don't know why yet) uninstalled and then this happened. |
We need the component to be installed for the tooling to work so that's expected. I'm curious as to why it got uninstalled though. @freddyaboulton should we install as part of the build step to be certain? |
I think one thing that would be helpful is to throw an error when examine.py has a problem, instead of silently continuing. Then the user at least knows something is wrong. |
Yeah. I'll try to surface that error in the logs for easier debugging. |
Very mysterious that this happened. Not sure either but have not seen it happen.
I think we can error in the build step if the component is not installed rather than installing it again because most times the component will already be installed. I like the suggestion to surface a log in |
Sounds good!
Yep, I'll take care of that today! |
Describe the bug
I am trying to write a custom component. I then build it with gradio cc build. This works fine a couple of times, but at some point it stops updating the files in
backend\...\templates\component\
That means that the created wheel then contains the newly built python part, but the js part is from the last build that worked correctly.
The only way I found to correct this, is to make a new directory with
gradio cc create
and copy my changed files into there again. The nextgradio cc build
from the new directory will work then. But eventually that too will stop building the js files.This makes developing the component pretty much impossible.
Have you searched existing issues? 🔎
Reproduction
gradio cc create MyComponent --template Gallery
Change the
frontend\shared\Gallery.svelte
filegradio cc build --bump-version
Keep repeating changing Gallery.svelte and building. At some (seemingly random?) point it stops updating the files in
backend\...\templates\component\
Screenshot
There are no errors or logs:
Logs
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: