abi / screenshot-to-code

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
https://screenshottocode.com
MIT License
60.52k stars 7.43k forks source link

Error generating code #405

Open seethun opened 2 months ago

seethun commented 2 months ago

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.
  5. I dont see log files. Let me know where thats located
abi commented 2 months ago

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?

3shimi commented 1 month ago

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 commented 1 month ago

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

abi commented 1 month ago

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

a491004300 commented 1 month ago

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