adrianhajdin/project_ai_mern_image_generation

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined

rileyshen opened this issue · 2 comments

I GOT GET http://127.0.0.1:5173/favicon.ico 404 (Not Found) problem, but the server shows UnhandledPromiseRejectionWarning problem.

Please somebody help to solve my problem, thanks.

(node:4048) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined
at file:///F:/projects/starlink/server/routes/dalleRoutes.js:34:45
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use node --trace-warnings ... to show where the warning was created)
(node:4048) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:4048) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error: connect ETIMEDOUT 64.13.192.74:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '64.13.192.74',
port: 443,
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},

exactly what were you trying to do?

i fixed this issue, and i did it by updating the openai, you should make sure its the same version as the one that adrian uses in his package.json