Nutlope / roomGPT

Upload a photo of your room to generate your dream room with AI.
https://www.roomgpt.io/
MIT License
9.76k stars 1.29k forks source link

Error after uploading an image on my server. #18

Closed itmp9 closed 1 year ago

itmp9 commented 1 year ago

Hello! The installation was successful, and the page is loading. But when trying to upload a room image, I am getting this error. What should I do? Thx!

> dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 3s (170 modules)
wait  - compiling...
event - compiled successfully in 175 ms (135 modules)
wait  - compiling /_error (client and server)...
event - compiled client and server successfully in 117 ms (171 modules)
warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
wait  - compiling /dream (client and server)...
event - compiled client and server successfully in 1138 ms (963 modules)
wait  - compiling /...
event - compiled client and server successfully in 182 ms (246 modules)
wait  - compiling /dream (client and server)...
event - compiled client and server successfully in 293 ms (969 modules)
wait  - compiling /api/generate (client and server)...
event - compiled successfully in 49 ms (119 modules)
wait  - compiling /_error (client and server)...
error - pages/api/generate.ts (77:43) @ get
error - TypeError: Cannot read properties of undefined (reading 'get')
    at handler (webpack-internal:///(api)/./pages/api/generate.ts:53:46)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/home/itmp9/roomGPT/node_modules/next/dist/server/api-utils/node.js:372:9)
    at async DevServer.runApi (/home/itmp9/roomGPT/node_modules/next/dist/server/next-server.js:488:9)
    at async Object.fn (/home/itmp9/roomGPT/node_modules/next/dist/server/next-server.js:751:37)
    at async Router.execute (/home/itmp9/roomGPT/node_modules/next/dist/server/router.js:253:36)
    at async DevServer.run (/home/itmp9/roomGPT/node_modules/next/dist/server/base-server.js:384:29)
    at async DevServer.run (/home/itmp9/roomGPT/node_modules/next/dist/server/dev/next-dev-server.js:743:20)
    at async DevServer.handleRequest (/home/itmp9/roomGPT/node_modules/next/dist/server/base-server.js:322:20) {
  page: '/api/generate'
}
  75 |   let jsonStartResponse = await startResponse.json();
  76 | 
> 77 |   let endpointUrl = jsonStartResponse.urls.get;
     |                                           ^
  78 |   const originalImage = jsonStartResponse.input.image;
  79 |   const roomId = jsonStartResponse.id;
  80 | 
event - compiled client and server successfully in 109 ms (977 modules)

image

jiridostal commented 1 year ago

Just run your dev instance like this REPLICATE_API_KEY=$KEY npm run dev Replace $KEY with your actual key.

Nutlope commented 1 year ago

You need to create a Replicate account, make a .env file and add it there. Make sure you follow all the steps in the README.

Closing this issue for now, feel free to re-open if you have follow up questions.