You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am designing an app, and after someone fills out a form, an openAi assistant is retrieved (this works), and then the page is redirected to another page at which point I have this:
useEffect(()=>{constSendReqToBackend=async()=>{try{// make new threadconstthreadResult=awaitaxios.post('/api/create-thread')setThreadId(threadResult.id)// add thread id to requestData ObjectconstrequestDataWithID={
...requestData,ThreadID: threadResultd.id}constFirstMessage=awaitaxios.post('/api/create-message',requestDataWithID)constFirstRun=awaitaxios.post('/api/run-thread',requestDataWithID)}catch(error){console.error('Error sending data to backend: ',error);}}SendReqToBackend();// send request once when component mounts},[])// run once.
The issue is that it will make two requests to '/api/create-thread'. I disabled CORS as I read online that it could be a preflight issue, but it is still happening and I cannot figure out why. I am not sure if it will be a huge error in the app as this is the first thing I have designed, but I would rather it just be one, because everytime I use the app, the first create-thread request works, and the second gives me an error
10:30:40 AM [vite] http proxy error: /api/create-thread AggregateError at internalConnectMultiple (node:net:1114:18) at internalConnectMultiple (node:net:1177:5) at internalConnectMultiple (node:net:1177:5) at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18) at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1510:7) at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:130:8)
Any suggestions?
IMAGES:
Example Code
No response
Expected behavior
No response
Axios Version
No response
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered:
Describe the issue
I am designing an app, and after someone fills out a form, an openAi assistant is retrieved (this works), and then the page is redirected to another page at which point I have this:
The issue is that it will make two requests to '/api/create-thread'. I disabled CORS as I read online that it could be a preflight issue, but it is still happening and I cannot figure out why. I am not sure if it will be a huge error in the app as this is the first thing I have designed, but I would rather it just be one, because everytime I use the app, the first create-thread request works, and the second gives me an error
10:30:40 AM [vite] http proxy error: /api/create-thread AggregateError at internalConnectMultiple (node:net:1114:18) at internalConnectMultiple (node:net:1177:5) at internalConnectMultiple (node:net:1177:5) at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18) at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1510:7) at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:130:8)
Any suggestions?
IMAGES:
Example Code
No response
Expected behavior
No response
Axios Version
No response
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: