Skip to content

UI wont start #1011

Description

@lior-antonov

I haven't updated the UI because I was working on issues on my end. Now that I am on the latest commit the UI seems to start but when I open it inside a browser it turns into a blank page right before loading the documents(didn't do anything to reproduce):

Image

When I tried to run a dev build for better excpetions I got errors because the dev was running on "localhost:5173" but it was making calls to "localhost:8000".

I got some error with the execution in the UI logs and fixed it by changing:

@app.post("/exec", response_model=ExecResponse)
def exec_code(payload: ExecPayload) -> ExecResponse:
    # DANGER: This is a security risk. It allows arbitrary code execution.
    # Only use this in a trusted environment.
    # The `_locals` dict will be updated with any variables created in the code.
    _locals = {} # "MOCK_PROJECTS": MOCK_PROJECTS}
    print("executing: " + payload.code)
    try:
---------------
        exec(payload.code, _locals)
---------------
+++++++++++++++
        exec(payload.code, None, _locals)
+++++++++++++++
    except Exception as e:
        error = f"{type(e).__name__}: {e}"
        tb = traceback.format_exc()
        print("exec error:", tb)
        return ExecResponse(problem=Problem(error=error, traceback=tb))
    result = _locals.get("result", None)
    print("got:", result)
    return ExecResponse(data=jsonable_encoder(result))

But it still gave me the react errors... Here are commits I tried(hera+hermes) and the result:

  • (hera, hermes)=(master, master...acd7fa6d and probably all) - fails both in incognito and regular browser with react error
  • (hera, hermes)=(master...6467d29, master...e006f5ef and probably all) - fails both in incognito and regular browser with react error
  • (hera, hermes)=(4c8023f, master...e006f5ef) - works in incognito but fails in regular browser with react error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions