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

Error generating code in Local with Anthropic Key

jme418 opened this issue · comments

Hi there! I saw that in hosted version a message saying I need to suscribe to a plan to use an Anthropic key appeared once I dropped an screenshot so I thought I had to be suscribed to an Anthropic plan and not a screenshot-to-code one (my fault).

Now I'm trying to use the credit I have but the only thing I am getting are errors. Now I will show all I did and the error that I am getting:

backend

.env file:

image

other commands:

image

frontend

image

error

image

That is all I have done I do not see any log indicating a problem or anything like that so I need help please. Thanks.

Thanks for sharing all the screens. Seems like you followed the steps correctly.

  1. Can you visit 127.0.0.1:7001 in your browser? What does it look like?
  2. Can you open your browser console after you drop in an image and let me know what's in there?

Thanks to you for answering @abi! Looks like the problem has something to do with what you mentioned...

image

image

yeah, looks like your backend server is not actually running at that address. You're definitely running it locally on the same computer as you're using the browser on?

yeah, looks like your backend server is not actually running at that address. You're definitely running it locally on the same computer as you're using the browser on?

Yes, 99.999% sure.

Can you try localhost:7001 in your browser?

Make sure it's http, not https

Can you try localhost:7001 in your browser?

Of course, and it looks like I am getting the exact same error.

image

I have tried with http, https and different browsers with cache being refreshed. Also cloning the repository once again and re-executing the commands.

@abi, if I execute uvicorn command changing port to 8000 for example look at what I get. (I guess I would have to do more changes to make it run properly because I have tried again and frontend console gives me the same errors that I showed in a previous message, in which port 7001 is referenced)

image

Amazing. That means you can switch the front-end to connect to :8000 and everything should work. See 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?"

If it works, please close this issue :)

Amazing. That means you can switch the front-end to connect to :8000 and everything should work. See 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?"

If it works, please close this issue :)

It works! Closing issue with a smile in my face :)