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 when following contribution guide #1542

Open
PyroGenesis opened this issue Nov 25, 2024 · 3 comments
Open

Error when following contribution guide #1542

PyroGenesis opened this issue Nov 25, 2024 · 3 comments
Labels
backend Pertains to the Python backend. bug Something isn't working needs-triage

Comments

@PyroGenesis
Copy link

Describe the bug
I am trying to build chainlit on my local Windows system. However, I'm running into an error on the step Start the Chainlit server from source

Traceback (most recent call last):
  File "C:\Projects\chainlit\backend\.venv\Scripts\chainlit", line 6, in <module>
    sys.exit(cli())
  File "C:\Projects\chainlit\backend\.venv\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Projects\chainlit\backend\.venv\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Projects\chainlit\backend\.venv\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Projects\chainlit\backend\.venv\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Projects\chainlit\backend\.venv\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Projects\chainlit\backend\chainlit\cli\__init__.py", line 201, in chainlit_run
    run_chainlit(target)
  File "C:\Projects\chainlit\backend\chainlit\cli\__init__.py", line 39, in run_chainlit
    from chainlit.server import app
  File "C:\Projects\chainlit\backend\chainlit\server.py", line 184, in <module>
    build_dir = get_build_dir("frontend", "frontend")
  File "C:\Projects\chainlit\backend\chainlit\server.py", line 181, in get_build_dir
    raise FileNotFoundError(f"{local_target} built UI dir not found")
FileNotFoundError: frontend built UI dir not found

To Reproduce
Follow the steps listed in CONTRIBUTING.md

Expected behavior
Expected to successfully run the backend

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 1.3.1
@dosubot dosubot bot added backend Pertains to the Python backend. bug Something isn't working labels Nov 25, 2024
@dokterbob
Copy link
Collaborator

Thanks for reporting this! Always important to make sure dev's don't run into trouble!

I'll have to test this myself. Until then, perhaps #1500 is related?

@dosu Any idea what's going on?

Copy link

dosubot bot commented Dec 3, 2024

The error you're encountering, FileNotFoundError: frontend built UI dir not found, indicates that the frontend build directory is missing. Here are the steps to resolve this issue:

  1. Check the Build Directory: Ensure that the "dist" directory exists in the expected location. The code looks for this directory at os.path.join(PACKAGE_ROOT, "frontend", "dist") and os.path.join(BACKEND_ROOT, "frontend", "dist").

  2. Build the Frontend: If the directory does not exist, you need to build the frontend. Navigate to the frontend directory and run the following commands:

    pnpm install
    pnpm run dev --port 5174

    This will install the necessary dependencies and start the development server for the frontend. Make sure you have pnpm installed and configured correctly on your Windows system. You might need to set the script shell to bash using:

    pnpm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
  3. Verify Custom Build Path: If you have a custom build path specified in your configuration (config.ui.custom_build), ensure that the path is correct and the build output is present there.

Following these steps should help you resolve the error and successfully run the Chainlit server from source [1][2].

To continue talking to Dosu, mention @dosu.

@dokterbob
Copy link
Collaborator

The frontend should be built when you do poetry install.

Could you share the full terminal output when this error occurs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pertains to the Python backend. bug Something isn't working needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants