screenshot-to-code icon indicating copy to clipboard operation
screenshot-to-code copied to clipboard

Error generating code

Open seethun opened this issue 1 year ago • 5 comments

I get an error when converting screenshot to code on self hosted application

Steps to reproduce the behavior:

  1. Self host this application per readme
  2. Upload image to convert to code.
  3. The application shows the error message - "Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue"
  4. I don't see any errors in the developer console. See below
screenshot-to-code/backend# sudo poetry run uvicorn main:app --reload --port 7001
INFO:     Will watch for changes in these directories: ['/home/admin/dev/devtools/screenshot-to-code/backend']
INFO:     Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO:     Started reloader process [445283] using StatReload
INFO:     Started server process [445287]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
  1. I dont see log files. Let me know where thats located

seethun avatar Sep 15 '24 10:09 seethun

You're likely running into issues where the front-end is not connecting to the backend. Are they running on the same machine? What happens when you go to http://127.0.0.1:7001?

abi avatar Sep 15 '24 16:09 abi

i have same problem, when i go to http://127.0.0.1:7001, it says ERR_CONNECTION_REFUSED. Both front and back are on the same machine.

3shimi avatar Sep 26 '24 03:09 3shimi

not sure if it matters, it shows on my backend console: "TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'"

3shimi avatar Sep 26 '24 03:09 3shimi

@3shimi can you share the logs from both front-end and back-end running?

abi avatar Sep 26 '24 12:09 abi

Skipping virtualenv creation, as specified in config file. /usr/local/lib/python3.12/site-packages/moviepy/config_defaults.py:1: SyntaxWarning: invalid escape sequence '\P' """ /usr/local/lib/python3.12/site-packages/moviepy/video/io/ffmpeg_reader.py:294: SyntaxWarning: invalid escape sequence '\d' lines_video = [l for l in lines if ' Video: ' in l and re.search('\d+x\d+', l)] /usr/local/lib/python3.12/site-packages/moviepy/video/io/ffmpeg_reader.py:367: SyntaxWarning: invalid escape sequence '\d' rotation_lines = [l for l in lines if 'rotate :' in l and re.search('\d+$', l)] /usr/local/lib/python3.12/site-packages/moviepy/video/io/ffmpeg_reader.py:370: SyntaxWarning: invalid escape sequence '\d' match = re.search('\d+$', rotation_line) INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:7001 (Press CTRL+C to quit)

yarn run v1.22.22 $ vite --host 0.0.0.0

VITE v4.5.0 ready in 326 ms

➜ Local: http://localhost:5173/ ➜ Network: http://172.23.0.3:5173/

ERROR [TypeScript] Found 0 errors. Watching for file changes.

WARN Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme

a491004300 avatar Oct 10 '24 02:10 a491004300