openai / openai-node

Official JavaScript / TypeScript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.97k stars 870 forks source link

Build Warnings when building for Edge Runtime #1118

Open karlomedallo opened 1 month ago

karlomedallo commented 1 month ago

Confirm this is a Node library issue and not an underlying OpenAI API issue

Describe the bug

I see:

../../node_modules/.pnpm/openai@4.67.1_zod@3.23.8/node_modules/openai/core.mjs
A Node.js API is used (process.version at line: 575) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runti

To Reproduce

  1. create a route handler in NextJS that is configured to run in edge
  2. import openai package
  3. run build

Code snippets

No response

OS

macOS

Node version

v20.16.0

Library version

4.67.1