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

Error following custom components docs gradio cc dev (virtual:component-loader) #8661

Open
1 task done
abmnv opened this issue Jun 28, 2024 · 8 comments
Open
1 task done
Labels
bug Something isn't working custom-components Related to custom component cli or workflow

Comments

@abmnv
Copy link

abmnv commented Jun 28, 2024

Describe the bug

I am following documentation for creating Custom Components on MacOS and getting the following error after running "gradio cc dev" step: "Internal server error: Failed to resolve import "virtual:component-loader" from "frontend/node_modules/@gradio/utils/src/utils.ts?v=365c25ca". Does
the file exist?". The file "utils.ts" does exists in the node_modules directory. The error seems to point to Vite virtual modules that may be is not configured properly.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

gradio cc create MyComponent --template SimpleTextbox
gradio cc dev

Screenshot

Screen Shot 2024-06-28 at 3 36 56 PM

Logs

Internal server error: Failed to resolve import "virtual:component-loader" from "frontend/node_modules/@gradio/utils/src/utils.ts?v=365c25ca". Does 
the file exist?

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.37.1
gradio_client version: 1.0.2

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==1.0.2 is not installed.
httpx: 0.27.0
huggingface-hub: 0.23.4
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 2.0.0
orjson: 3.10.5
packaging: 24.1
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.4
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.10
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.2
urllib3: 2.2.2
uvicorn: 0.30.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.6.1
httpx: 0.27.0
huggingface-hub: 0.23.4
packaging: 24.1
typing-extensions: 4.12.2
websockets: 11.0.3

Severity

Blocking usage of gradio

@abmnv abmnv added the bug Something isn't working label Jun 28, 2024
@alpaolo
Copy link

alpaolo commented Jul 1, 2024

The same for me on windows 11 and Wsl2. Node 18 and Node 20 Python 3.10 and 3.12 always the same error. This kind of error doesn't appear only using Button as template. #8669
344430995-1e080a92-a04d-4a62-86ec-1955503c10c8

@abidlabs abidlabs added the custom-components Related to custom component cli or workflow label Jul 1, 2024
@freddyaboulton
Copy link
Collaborator

@pngwn looks like it could be related to the chatbot changes related to loading components? The issue does not happen in version 4.36.1

@khengyun
Copy link

khengyun commented Jul 2, 2024

@pngwn looks like it could be related to the chatbot changes related to loading components? The issue does not happen in version 4.36.1

this issue still happend in gradio version 4.36.1

@freddyaboulton
Copy link
Collaborator

I can't repro on 4.36.1 with the textbox template!

@khengyun
Copy link

khengyun commented Jul 2, 2024

This error does not occur if python==3.11.9 and node==v18.20.3, it not affected by gradio version

@alpaolo
Copy link

alpaolo commented Jul 2, 2024

This error does not occur if python==3.11.9 and node==v18.20.3, and gradio==4.36.1
This is the answer on Custom component --template Label:
'''No custom components were found in G:\GRADIO\CUSTOM_COMPONENTS\superlabel. It is likely that dev mode does not work properly. Please pass the --gradio-path and --python-path CLI arguments so that gradio uses the right executables."
And nothing load in browser'''

If supply python-path and gradio-path as arguments:
Screenshot 2024-07-02 184337

I like Gradio but this kind of error made me crazy ( too much dependency: Node, Svelte, Vite... )

@alpaolo
Copy link

alpaolo commented Jul 2, 2024

Error on wsl2 python==3.11.9 and node==v18.20.3, and gradio==4.37.2
Screenshot 2024-07-02 231631

@alpaolo
Copy link

alpaolo commented Jul 2, 2024

I can't repro on 4.36.1 with the textbox template!

Work only with Button template, with other template component no, Textbox too.
Is possible there's a combination between components and other frameworks ( Node ? Vite ? Compiler ?) that creates a bad environment.
Furthermore, the code in button.svelte calls a minimum quantity of modules....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working custom-components Related to custom component cli or workflow
Projects
None yet
Development

No branches or pull requests

5 participants