openai/openai-node

Bun runtime error: Cannot find module "openai/_shims/auto/runtime" from "/app/.output/server/node_modules/openai/_shims/index.mjs"

marcelxpfeifer opened this issue · 2 comments

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

When trying to run OpenAI in production with bun I get the following error
Cannot find module "openai/_shims/auto/runtime" from "/app/.output/server/node_modules/openai/_shims/index.mjs"

It can be reproduced with minimal setup using Nuxt.

To Reproduce

  1. Clone the repo Minimal Reproduction
  2. Run bun install
  3. Run bun build
  4. Run bun .output/server/index.mjs
  5. When opening localhost:3000/api/test the server should throw the error

Running with node works

Code snippets

No response

OS

macOS, Linux

Node version

Bun v1.1.26

Library version

openai v4.56.0

@marcelxpfeifer thanks for the report, if you haven't already could you also report this to bun?

@marcelxpfeifer thanks for the report, if you haven't already could you also report this to bun?

Yes the issue can be found here