Comments (3)
Hey @encima! So strange. Your code also errors for me locally:
Using supabase-edge-runtime-1.53.3 (compatible with Deno v1.40.3)
serving the request with /home/deno/functions/generate-workout
runtime has escaped from the event loop unexpectedly: event loop error: ReferenceError: _computedKey is not defined
at https://deno.land/x/[email protected]/lib/ChatCompletionStream.ts:4:14
user worker failed to respond: user worker not available
TypeError: request body receiver not connected (channel closed)
at Object.write (ext:deno_web/06_streams.js:1155:20)
at Module.invokeCallbackFunction (ext:deno_webidl/00_webidl.js:944:16)
at WritableStreamDefaultController.writeAlgorithm (ext:deno_web/06_streams.js:3915:14)
at writableStreamDefaultControllerProcessWrite (ext:deno_web/06_streams.js:4485:55)
at writableStreamDefaultControllerAdvanceQueueIfNeeded (ext:deno_web/06_streams.js:4388:5)
at writableStreamDefaultControllerWrite (ext:deno_web/06_streams.js:4532:3)
at writableStreamDefaultWriterWrite (ext:deno_web/06_streams.js:4679:3)
at Object.chunkSteps (ext:deno_web/06_streams.js:2743:17)
at readableStreamFulfillReadRequest (ext:deno_web/06_streams.js:2585:17)
at readableByteStreamControllerCommitPullIntoDescriptor (ext:deno_web/06_streams.js:2276:5)
I have:
macOS: Sonoma 14.5
supabase-cli: 1.172.2
node: v18.16.0
from supabase.
Hey there,
Thanks for opening!
Is this on hosted or running locally?
I cannot reproduce this when running locally and the example in the docs works when using the Deno package you outlined:
import OpenAI from 'https://deno.land/x/[email protected]/mod.ts'
Deno.serve(async (req) => {
const { query } = await req.json()
const apiKey = Deno.env.get('OPENAI_API_KEY')
const openai = new OpenAI({
apiKey: apiKey,
})
// Documentation here: https://github.com/openai/openai-node
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: query }],
// Choose model from here: https://platform.openai.com/docs/models
model: 'gpt-3.5-turbo',
stream: false,
})
const reply = chatCompletion.choices[0].message.content
return new Response(reply, {
headers: { 'Content-Type': 'text/plain' },
})
})
Are you making sure that you create the client inside the serve
function? If yes, can you provide a full reproducible code sample, please?
from supabase.
Running into this same issue locally, if I downgrade the Supabase CLI to 1.166.3 it resolves the issue (it's broken starting at 1.167.0).
Looks related to an issue in the Deno runtime: denoland/deno#22109
from supabase.
Related Issues (20)
- Request timeout on Supabase Edge Functions when using grammy/conversations
- Unable to insert into table: No subscribers for pool
- Use additional API keys is not working like in the documentation
- Disabling "Realtime" for a single table disables realtime for the entire database HOT 2
- pgcrypto functions not working inside triggers HOT 1
- Supabase Google Authentication Issue (upstream connect error) HOT 1
- Issues with Flutter Connection sample HOT 1
- TypeError: bind.callback is not a function when receiving broadcast HOT 1
- Updating JWT secret takes forever... HOT 5
- Mujhe maro
- RPC not working for my API route. HOT 2
- 404 page (Twilio Phone Auth Guide) HOT 4
- Prisma freezes when migration is triggered HOT 11
- Missing dashboard generated types alternative HOT 1
- Questions and Issues Regarding Local Deployment of Supabase HOT 3
- Unexpected AuthException during supabase auth `verifyOTP` email change flow
- Social OAuth for Keycloak guide (auth-keycloak.mdx) needs an update
- Column does not exist (when loading json in dashboard) HOT 1
- Cant use GraphQL introspection query after following tutorial for RBAC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supabase.