Skip to content

Instantly share code, notes, and snippets.

@mizchi
Last active February 7, 2024 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizchi/3df74513d3c605c99e9c0aedc613f4c1 to your computer and use it in GitHub Desktop.
Save mizchi/3df74513d3c605c99e9c0aedc613f4c1 to your computer and use it in GitHub Desktop.

Issue draft for https://github.com/openai/openai-deno-build or deno itself

tl;dr

  • openai-deno-build does not work with deno 1.40.*

Reproduce

This is bug for https://github.com/openai/openai-deno-build

  • deno: v1.40.3
  • openai-deno-build: v4.20.1

Put run.ts

import { OpenAI } from "https://deno.land/x/openai@v4.20.1/mod.ts";
const _client = new OpenAI({
  apiKey: Deno.env.get("OPENAI_API_KEY")!,
});
$ deno run -A run.ts
error: Uncaught (in promise) ReferenceError: _computedKey is not defined
Warning Couldn't format source line: Column 42 is out of bounds (source may have changed at runtime)
    at https://deno.land/x/openai@v4.20.1/lib/ChatCompletionStream.ts:15:42

But it works with deno@1.39.4.

My research

Variable _computedKey is not used in https://deno.land/x/openai@v4.20.1/lib/ChatCompletionStream.ts

So I doubt there is bug from transpiling of for await in deno@1.40.*

Work arround

It works with deno@1.39.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment