Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
artemmarkov050 opened this issue Dec 23, 2024 · 6 comments

Comments

@artemmarkov050
Copy link

2024-12-23_16-02-04

there is such a problem, has anyone encountered it? How to solve it?

@yeboahd24
Copy link

Not interested again.

@abi
Copy link
Owner

abi commented Dec 23, 2024

@artemmarkov050 please share your backend and front-end logs to help with debugging.

@TuanVnit
Copy link

I am facing a similar issue as the one mentioned above. I have made a domain public for everyone to use based on the LAN IP. People access the link I shared with the IP, and then the mentioned error appears.
image

@abi
Copy link
Owner

abi commented Dec 24, 2024

@TuanVnit yes you need to update the backend URL env if you're accessing it from a front-end on a different computer.

@ericlarslee
Copy link

This is the primary error I get on the backend:
PS C:\Users\ericl\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend> poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['C:\Users\ericl\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [2164] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Python313\Lib\multiprocessing\process.py", line 313, in _bootstrap
self.run()
~~~~~~~~^^
File "C:\Python313\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python313\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "C:\Python313\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Python313\Lib\asyncio\base_events.py", line 720, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
~~~~~~~~~~~^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "C:\Python313\Lib\importlib_init
.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\ericl\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend\main.py", line 4, in
load_dotenv()
~~~~~~~~~~~^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 356, in load_dotenv
return dotenv.set_as_environment_variables()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 92, in set_as_environment_variables
if not self.dict():
~~~~~~~~~^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 76, in dict
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 238, in resolve_variables
for (name, value) in values:
^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 84, in parse
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\main.py", line 26, in with_warn_for_invalid_lines
for mapping in mappings:
^^^^^^^^
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream
reader = Reader(stream)
File "C:\Users\ericl\AppData\Local\pypoetry\Cache\virtualenvs\backend-ulQFLN8h-py3.13\Lib\site-packages\dotenv\parser.py", line 64, in init
self.string = stream.read()
~~~~~~~~~~~^^
File "", line 325, in decode

@abi
Copy link
Owner

abi commented Jan 29, 2025

@ericlarslee i think something is up with your .env file. I think there's a utf-8 fix described in the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants