fix(openai): remove obsolete openai/shims/node import from sample#38417
Merged
Conversation
The openai/shims/node import is no longer needed in openai v6+. The Node.js polyfills are now handled automatically by the library. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes an obsolete openai/shims/node side-effect import from the OpenAI text-to-speech development sample so the package’s sample TypeScript build works again with the current OpenAI v6 dependency.
Changes:
- Deletes the
openai/shims/nodeimport fromsamples-dev/textToSpeech.ts. - Keeps the sample aligned with the package’s current
openaidependency, where Node polyfills are no longer imported this way. - Targets the
build:samplesCI failure described in the PR by unblocking compilation of the dev sample source.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The types subpath is for TypeScript augmentation only and shouldn't be required in JavaScript samples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jeremymeng
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the obsolete
import "openai/shims/node"fromsamples-dev/textToSpeech.ts.The
openai/shims/nodeimport was used in openai SDK versions before v6 to add Node.js-specific polyfills for globals likefetchandFormData. In openai v6+, these polyfills are handled automatically by the library, so the import is no longer needed and actually fails because the export no longer exists.Fixes
js - pullrequestcaused byTS2882: Cannot find module or type declarations for side-effect import of 'openai/shims/node'Testing
pnpm run build:samplespasses locally