FG
🤖 AI & LLMsOpenAI

Can't build NextJS project with openai library. Getting: Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher.

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score89%
89%

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 Getting this kind of error on build time on NextJS 14 and I don't know why this is my tsconfig.json [code block] Thanks for help. To Reproduce 1) Install and use library on nextjs 2) import something like `import typoe { Message } from 'openai/resources/beta/threads/messages';` Code snippets _No response_ OS macOS Node version v22.3.0 Library version 4.52.3

Error Output

error on build time on NextJS 14 and I don't know why

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: Can't build NextJS project with openai library. Getting: Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher.

Low Risk

updates: if I remove every import `from 'openai/resources/beta/****';` all works but the question is about using proper types. Any ideas?

84

Trust Score

1 verification

100% success
  1. 1

    Step 1

    if I remove every import `from 'openai/resources/beta/****';` all works but the question is about using proper types. Any ideas?

Validation

Resolved in openai/openai-node GitHub issue #922. 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

openaigptllmapiquestion