abi / screenshot-to-code

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Home Page:https://screenshottocode.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue.

summerainX opened this issue · comments

i use docker to run this project
but it error when I upload picture ,it prompt that:
User Error generating code. Check the Developer Console AND the backend logs for details. Feel free to open a Github issue.
i check web console:
图片

and my backend seem no any logs got
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 sequ
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 sequ
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 sequ
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)
INFO: 198.235.24.103:62166 - "GET / HTTP/1.1" 200 OK
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
INFO: 34.68.34.84:46093 - "GET / HTTP/1.1" 200 OK
INFO: 34.68.34.84:46093 - "GET /index.html HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /doesntexist-123 HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /bonita/login.jsp HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /admin HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /version HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /login HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /assets/favicon.png HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /ui/favicon.ico HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /login.html HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /static/images/favicon.ico HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /install HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /phpmyadmin/index.php HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /error.json HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /api HTTP/1.1" 404 Not Found
INFO: 34.68.34.84:46093 - "GET /admin HTTP/1.1" 404 Not Found
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.
WARNING: Invalid HTTP request received.

it seems that i should change some config to redirect my backend address?
i install program in linux。 and open it in my mac。

Can you try https://github.com/abi/screenshot-to-code?tab=readme-ov-file#%EF%B8%8F-faqs How can I update the backend host that my front-end connects to?

I think the issue might be that your backend is not running at 127.0.0.1

Can you try visiting 127.0.0.1:7000 as well? What do you see?

/usr/local/lib/python3.12/site-packages/moviepy/video/io/ffmpeg_reader.py:294: SyntaxWarning: invalid escape sequ
lines_video = [l for l in lines if ' Video: ' in l and re.search('\d+x\d+', l)]
may not see this log

I meet the same error, may be is not suitable of lib moviepy,just guess ,thank you sir,Looking forward to your reply

@qiangminmama have you tried the two things I suggested?

i see my docker ps seem backend port is 7001
图片
but i try your suggest,7000 and 7001 both have response like underline:
图片
should I try to change fronted/.env.example and restart my docker?
(ps: my dir dont have .env.local should I create one instead of .env.example?)
图片
by the way, i see the example you provide is the public ip,should I use public ip instead of 127.0.0.1?
Looking forward to your reply~

Yes, go to the backend URL in your browser. It should load a page successfully. If not you have the wrong ip or port.

Your port looks to be 7001 from the logs but instead of using curl, use your web browser to go to that URL.

i try your suggest but get the same response
图片
is it means I have a true conf?
w h at can I do to solve this problem?
Looking forward to your reply~

So your backend is working correctly.

Just set the correct URL and it should work: Can you try https://github.com/abi/screenshot-to-code?tab=readme-ov-file#%EF%B8%8F-faqs How can I update the backend host that my front-end connects to?

commented

link websocket error
image
http ok
image

How solve websocket error?

So at 10.0.... in your browser displays that web page?

commented

10.0... is private ip

Yes. So if that is working in the browser. The front end should be able to connect to it. Do you see any logs on the backend?

commented

Where is logs. I use docker run this project

commented

image
It seems like good, I don't know where is problem?

Closing due to inactivity