Skip to content

fix(openai): remove obsolete openai/shims/node import from sample#38417

Merged
deyaaeldeen merged 3 commits into
mainfrom
fix-openai-samples-shims-import
May 8, 2026
Merged

fix(openai): remove obsolete openai/shims/node import from sample#38417
deyaaeldeen merged 3 commits into
mainfrom
fix-openai-samples-shims-import

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

Description

Removes the obsolete import "openai/shims/node" from samples-dev/textToSpeech.ts.

The openai/shims/node import was used in openai SDK versions before v6 to add Node.js-specific polyfills for globals like fetch and FormData. 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

  • Fixes CI sample build failures in js - pullrequest caused by TS2882: Cannot find module or type declarations for side-effect import of 'openai/shims/node'

Testing

  • Verified pnpm run build:samples passes locally

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>
Copilot AI review requested due to automatic review settings May 5, 2026 00:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/node import from samples-dev/textToSpeech.ts.
  • Keeps the sample aligned with the package’s current openai dependency, where Node polyfills are no longer imported this way.
  • Targets the build:samples CI failure described in the PR by unblocking compilation of the dev sample source.

Comment thread sdk/openai/openai/samples-dev/textToSpeech.ts
Deyaaeldeen Almahallawi and others added 2 commits May 5, 2026 01:17
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>
@deyaaeldeen deyaaeldeen merged commit c12db0c into main May 8, 2026
12 checks passed
@deyaaeldeen deyaaeldeen deleted the fix-openai-samples-shims-import branch May 8, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants