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

Heeeelp! can not run #34

Closed
nzd520 opened this issue Nov 19, 2023 · 19 comments
Closed

Heeeelp! can not run #34

nzd520 opened this issue Nov 19, 2023 · 19 comments

Comments

@nzd520
Copy link

nzd520 commented Nov 19, 2023

Heeeelp! I ran it locally, but on the website, "Error generating code. Check the Developer Console for details. Feel free to open a Github issue." The project can run on both the front and back ends, but when the back end runs, a message "The current project could not be installed: No file/folder found for package backend If you do not want to install the current project use --no-root ", I do not know whether it is relevant

@nzd520
Copy link
Author

nzd520 commented Nov 19, 2023

when i push F12, the source on web said
"
Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools
generateCode.ts? [sm]:23 Connecting to backend @ ws://127.0.0.1:7000/generate-code
generateCode.ts? [sm]:25 WebSocket connection to 'ws://127.0.0.1:7000/generate-code' failed:
generateCode @ generateCode.ts? [sm]:25
generateCode.ts? [sm]:56 WebSocket error Event
(anonymous) @ generateCode.ts? [sm]:56
generateCode.ts? [sm]:46 Connection closed 1006
generateCode.ts? [sm]:48 WebSocket error code CloseEvent
(anonymous) @ generateCode.ts? [sm]:48
"

@abi
Copy link
Owner

abi commented Nov 19, 2023

Would you look at the link in the README section? That should solve your problem.

@nzd520
Copy link
Author

nzd520 commented Nov 19, 2023

it dont work! TT .Create an OpenAI account. And then, you need to buy at least $1 worth of credit on the Billing dashboard. i do it, but it still said
"Error generating code. Check the Developer Console for details. Feel free to open a Github issue
Error generating code. Check the Developer Console for details. Feel free to open a Github issue"
how can i do!!!TT

@abi
Copy link
Owner

abi commented Nov 20, 2023

Could you paste your backend logs? That should be helpful in understanding the issue.

@nickcarterney
Copy link

nickcarterney commented Nov 20, 2023

Could you paste your backend logs? That should be helpful in understanding the issue.

We're using your demo site with our ChatGPT-4 API key: https://picoapps.xyz/free-tools/screenshot-to-code

@nzd520
Copy link
Author

nzd520 commented Nov 20, 2023

backend logs:
"

poetry install
poetry shell
poetry run uvicorn main:app --reload --port 7000
Installing dependencies from lock file

Installing the current project: backend (0.1.0)
The current project could not be installed: No file/folder found for package backend
If you do not want to install the current project use --no-root
Spawning shell within C:\Users\小小峰\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\Local\pypoetry\Cache\virtualenvs\backend-mf7PE-pK-py3.10
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6
"
I runit on VSCode

@nzd520
Copy link
Author

nzd520 commented Nov 20, 2023

in frontend factory, the @tailwind in 'index.css' said Unknown at rule @tailwindcss(unknownAtRules) ,is that problem?

@abi
Copy link
Owner

abi commented Nov 20, 2023

@nzd520 have you tried this? #3 (comment)

@abi
Copy link
Owner

abi commented Nov 20, 2023

@nickcartery not offering support for hosted version at the moment. Please run locally.

@nzd520
Copy link
Author

nzd520 commented Nov 21, 2023

i try it, but still can`t work , on the website console, it said
"
Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools
generateCode.ts? [sm]:23 Connecting to backend @ ws://127.0.0.1:7001/generate-code
generateCode.ts? [sm]:25 WebSocket connection to 'ws://127.0.0.1:7001/generate-code' failed:
generateCode @ generateCode.ts? [sm]:25
doGenerateCode @ App.tsx? [sm]:72
doCreate @ App.tsx? [sm]:85
(anonymous) @ ImageUpload.tsx? [sm]:80
generateCode.ts? [sm]:56 WebSocket error Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
(anonymous) @ generateCode.ts? [sm]:56
error (async)
generateCode @ generateCode.ts? [sm]:55
doGenerateCode @ App.tsx? [sm]:72
doCreate @ App.tsx? [sm]:85
(anonymous) @ ImageUpload.tsx? [sm]:80
Promise.then (async)
onDrop @ ImageUpload.tsx? [sm]:79
(anonymous) @ index.js:708
(anonymous) @ index.js:759
Promise.then (async)
(anonymous) @ index.js:758
(anonymous) @ index.js:831
(anonymous) @ index.js:192
(anonymous) @ index.js:190
callCallback2 @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
Show 21 more frames
generateCode.ts? [sm]:46 Connection closed 1006
generateCode.ts? [sm]:48 WebSocket error code CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: '', type: 'close', …}isTrusted: truebubbles: falsecancelBubble: falsecancelable: falsecode: 1006composed: falsecurrentTarget: WebSocket {url: 'ws://127.0.0.1:7001/generate-code', readyState: 3, bufferedAmount: 0, onopen: null, onerror: null, …}defaultPrevented: falseeventPhase: 0reason: ""returnValue: truesrcElement: WebSocket {url: 'ws://127.0.0.1:7001/generate-code', readyState: 3, bufferedAmount: 0, onopen: null, onerror: null, …}target: WebSocket {url: 'ws://127.0.0.1:7001/generate-code', readyState: 3, bufferedAmount: 0, onopen: null, onerror: null, …}timeStamp: 10828type: "close"wasClean: false[[Prototype]]: CloseEvent
(anonymous) @ generateCode.ts? [sm]:48
"

is that problem? plz TT i really want to try this

@abi
Copy link
Owner

abi commented Nov 21, 2023

@nzd520 can you share backend logs again? front-end logs are not very helpful, all they say is that the generate code endpoint is failing.

@nzd520
Copy link
Author

nzd520 commented Nov 21, 2023

now i run the backend code, sometimes it said
"

poetry install
poetry shell
poetry run uvicorn main:app --reload --port 7000
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: backend (0.1.0)
Virtual environment already activated: C:\Users\小小峰\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\Local\pypoetry\Cache\virtualenvs\backend-yc4DYrCP-py3.10
INFO: Will watch for changes in these directories: ['C:\Users\小小峰\Desktop\大二下文档\python-project\screenshot-to-code-main\backend']
INFO: Uvicorn running on http://127.0.0.1:7000 (Press CTRL+C to quit)
INFO: Started reloader process [25820] using StatReload
ERROR: Error loading ASGI app. Could not import module "main".
"
and i run the common #3 said:
"cd backend
mkdir backend # yes, inside backend
mv *.py backend/
poetry install
poetry shell
cd backend # yes, backend/backend
poetry run uvicorn main:app --reload --port 7000
"
sometimes it can run, like that:
"

poetry install
poetry shell
poetry run uvicorn main:app --reload --port 7000
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: backend (0.1.0)
Spawning shell within C:\Users\小小峰\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\Local\pypoetry\Cache\virtualenvs\backend-yc4DYrCP-py3.10
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6
"

Do you understand what I'm saying? Thank you very much!

@FuZZingB
Copy link

image
image
how i can fix this

@abi
Copy link
Owner

abi commented Nov 21, 2023

@FuZZingB your front end should be running at http://127.0.0.1:5173 not :7001

@FuZZingB
Copy link

image

@FuZZingB your front end should be running at http://127.0.0.1:5173 not :7001

not working

@abi
Copy link
Owner

abi commented Nov 21, 2023

@FuZZingB And what happens you load that page in the browser?

@NgXuanKhoa
Copy link

@FuZZingB And what happens you load that page in the browser?

image

@abi
Copy link
Owner

abi commented Nov 22, 2023

@NgXuanKhoa pretty sure you are going to http://127.0.0.1:7001 rather than front-end.

@abi
Copy link
Owner

abi commented Nov 22, 2023

Closing this because there's too many people talking about too many different issues. Please open new separate issues if you need help.

@abi abi closed this as completed Nov 22, 2023
Repository owner locked as off-topic and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants