Closed AlUlkesh closed 9 months ago
Well, I found the cause of the issue.
In this part of the Gradio code of venv\Lib\site-packages\gradio\node\examine.py:
module_name = pyproject_toml["project"]["name"]
module = importlib.import_module(module_name)
artifacts: list[str] = pyproject_toml["tool"]["hatch"]["build"]["artifacts"]
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 No module named xxx
exception.
After doing a pip install -e .
on my custom component it works again.
Not sure what the initial thing that causes this is though.
Hi @AlUlkesh !
I can't reproduce this locally. I made 7 modifications to the label value in the gallery on the index.svelte file and the build command always picked it up.
@pngwn Are you able to repro? I wonder if it's another Windows issue
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.
Mine got (don't know why yet) uninstalled and then this happened.
Very mysterious that this happened. Not sure either but have not seen it happen.
@freddyaboulton should we install as part of the build step to be certain?
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 examine.py
. Just to confirm you're going to do that @pngwn ? I can make the modifications to the build command.
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.
Sounds good!
I like the suggestion to surface a log in examine.py. Just to confirm you're going to do that @pngwn ?
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 thefrontend\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 inbackend\...\templates\component\
Screenshot
There are no errors or logs:
Logs
System Info
Severity
Blocking usage of gradio