FG
🤖 AI & LLMsOpenAI

4.40.0 -> 4.40.1: Breaking change - OpenAI is not a constructor

Freshalmost 2 years ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

Confirm this is a Node library issue and not an underlying OpenAI API issue - [x] This is an issue with the Node library Describe the bug Based on numbers, 4.40.1 is supposed to be a bug fix release over 4.40.0, so I didn't expect something to break. I have not tested the application after 4.40.1 to see if anything else is broken. const openai = new OpenAI({ ^ TypeError: OpenAI is not a constructor To Reproduce Code saved as test.js: [code block] [code block] Code snippets _No response_ OS WSL Ubuntu 24.04 LTS Node version v20.12.2 Library version 4.40.1

Error Output

Error: OpenAI is not a constructor

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: 4.40.0 -> 4.40.1: Breaking change - OpenAI is not a constructor

Low Risk

At New Relic we instrument this package and this behavior is causing issues. I want to echo from what @YasharF has said that this was released in a patch and is a breaking change. This works fine when doing [code block] so maybe the exports in package.json need updated as well to handle CJS?

84

Trust Score

1 verification

100% success
  1. 1

    At New Relic we instrument this package and this behavior is causing issues. I

    At New Relic we instrument this package and this behavior is causing issues. I want to echo from what @YasharF has said that this was released in a patch and is a breaking change. This works fine when doing

  2. 2

    so maybe the exports in package.json need updated as well to handle CJS?

    so maybe the exports in package.json need updated as well to handle CJS?

Validation

Resolved in openai/openai-node GitHub issue #816. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

openaigptllmapibug