openai-node: openai@4.12 do not work on deno runtime?
Confirm this is a Node library issue and not an underlying OpenAI API issue
- This is an issue with the Node library
Describe the bug
I try to import openai on my netlify edge function, it works well days ago, but today it raises:
error: Uncaught (in promise) Error: Module not found "https://esm.sh/v133/openai@4.12.4/denonext/resources.js".
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbg_new_15d3966e9981a196 (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm.generated.js:417:19)
at <anonymous> (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm_bg.wasm:1:93412)
at <anonymous> (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm_bg.wasm:1:1499594)
at <anonymous> (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm_bg.wasm:1:1938165)
at __wbg_adapter_40 (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm.generated.js:231:6)
at real (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/deno/vendor/deno.land/x/eszip@v0.40.0/eszip_wasm.generated.js:215:14)
at eventLoopTick (ext:core/01_core.js:183:11)
Note that I found /denonext/resources.js
missing from esm.sh. I don’t know if this is related.
To Reproduce
new a netlify edge function with just
import OpenAI from "https://esm.sh/openai"
and deploys it
Code snippets
No response
OS
Windows
Node version
deno
Library version
openai v4.12
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 22
Thank you for confirming!
We’ve now also published v4.16.1 which includes today’s api releases:
Going forward, we’ll be publishing to demo.land/x/openapi, which is the recommended way to use this package from supabase and netlify edge functions.
We’ve released
v4.15.3
to deno.land/x/, which you can use like so:We’re working to also publish 4.16.0, which contains the changes from DevDay’s announcements, shortly.
@joshling1919 can you open that as a separate issue, and share the code you’re using to make the request?
@rattrayalex My working import looks like this:
Hey,
I’m using
openai
in Supabase Edge Functions and getting the above error. I tried importing from bothnpm:openai@4.13.0
andhttps://raw.githubusercontent.com/openai/openai-node/v4.12.4-deno/mod.ts
deno CLI version
1.37.2
Thanks for the report, we’ll take a look.
On Sat, Oct 21 2023 at 1:35 AM, Muspi Merol @.***> wrote: