abi / screenshot-to-code

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

mistake #406

Open localmiracle opened 3 days ago

localmiracle commented 3 days ago

photo_2024-09-18_15-40-19

abi commented 3 days ago

Please provide logs as requested when opening a new issue

localmiracle commented 3 days ago

this is a response from vscode

(backend-py3.12) PS C:\Users\Максимка\Desktop\screenshot-to-code-main\backend> uvicorn main:app --reload --port 7001

INFO: Will watch for changes in these directories: ['C:\Users\Максимка\Desktop\screenshot-to-code-main\backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [68108] using StatReload INFO: Started server process [85672] INFO: Waiting for application startup. INFO: Application startup complete. INFO: 127.0.0.1:61758 - "GET / HTTP/1.1" 200 OK INFO: ('127.0.0.1', 61779) - "WebSocket /generate-code" [accepted] Incoming websocket connection... INFO: connection open Received params Using openAiApiKey from client-side settings dialog Using official OpenAI URL Generating react_tailwind code in image mode using Llm.CLAUDE_3_5_SONNET_2024_06_20... Status (variant 0): Generating code... Status (variant 1): Generating code... Error generating code. Please contact support. ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\uvicorn\protocols\websockets\websockets_impl.py", line 250, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\fastapi\applications.py", line 276, in call await super().call(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\middleware\errors.py", line 149, in call await self.app(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\middleware\cors.py", line 75, in call await self.app(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in call raise exc File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in call await self.app(scope, receive, sender) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call raise e File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\routing.py", line 718, in call await route.handle(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\routing.py", line 341, in handle await self.app(scope, receive, send) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\starlette\routing.py", line 82, in app await func(session) File "C:\Users\Максимка\AppData\Local\pypoetry\Cache\virtualenvs\backend-bbLjbw3J-py3.12\Lib\site-packages\fastapi\routing.py", line 289, in app await dependant.call(**values) File "C:\Users\Максимка\Desktop\screenshot-to-code-main\backend\routes\generate_code.py", line 324, in stream_code raise Exception("All generations failed") Exception: All generations failed INFO: connection closed

localmiracle commented 3 days ago

react-dom.development.js:29840 Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools generateCode.ts:30 Connecting to backend @ ws://127.0.0.1:7001/generate-code generateCode.ts:48 Error generating code Error generating code. Please contact support. (анонимный) @ generateCode.ts:48 generateCode.ts:54 Connection closed 4332 generateCode.ts:59 Known server error CloseEvent {isTrusted: true, wasClean: true, code: 4332, reason: '', type: 'close', …} (анонимный) @ generateCode.ts:59 index.ts-BWeybLTk.js:380 Extension Version 0.15.0 c8811c4 index.ts-BWeybLTk.js:381 Development Page chrome-extension://agjkebmgjmcckikllpabicoddephklgh/src/pages/dev/index.html

abi commented 3 days ago

Thanks! I made a change yesterday that unfortunately hides the underlying error during code generation. I'll need to push a new change tomorrow so we can have more information.

From what I can see so far,

It is starting to generating the code on the backend so you're getting some error from OpenAI and/or Anthropic. Do you have keys set for both models? And are you in a country where both APIs are accessible?

I'll add more logging tomorrow to further help with this issue.

localmiracle commented 3 days ago

Yes I have token OpenAI and Anthropic

qazwsx7410pl commented 1 day ago

I have the same problem , help

abi commented 1 day ago

@localmiracle I added more logging. If you pull the latest code and re-run it, please share the logs and I can help pinpoint the exact issue.

Tomicampos commented 1 day ago

Tengo exactamente el mismo inconveniente. Estoy trabajando local con docker. Cargue la api tal como dice el repositorio, pero me da ese error.