Can't build NextJS project with openai library. Getting: Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher.
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
Solution: Can't build NextJS project with openai library. Getting: Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher.
updates: if I remove every import `from 'openai/resources/beta/****';` all works but the question is about using proper types. Any ideas?
Trust Score
1 verification
- 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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep