Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer Polyfill Missing File Export #28120

Open
morrisvdbeek opened this issue Feb 14, 2025 · 1 comment
Open

Buffer Polyfill Missing File Export #28120

morrisvdbeek opened this issue Feb 14, 2025 · 1 comment

Comments

@morrisvdbeek
Copy link

Environment

  • Deno Version: 2.1.10
  • Related Projects: Next.js, Vercel edge-runtime
  • Component: Node.js Compatibility Layer (Buffer Polyfill)

Description

The current implementation of Deno's Buffer polyfill does not properly export the File class, despite this being documented in the official Deno API documentation. This omission causes runtime errors when using frameworks that depend on this export, particularly in edge runtime environments.

Current Behavior

When attempting to access the File export from the Buffer polyfill, the following error is thrown:
Error: Attempt to export a nullable value for "File"
at eventLoopTick (ext:core/01_core.js:177:7)

Expected Behavior

According to the Deno documentation, the Buffer implementation should export a File class that extends Blob.

Reproduction

This issue can be reproduced in projects using Next.js with edge runtime, where the edge-runtime attempts to access the File export from the Buffer polyfill.

Technical Details

  • Affected polyfill location: ext/node/polyfills/internal/buffer.mjs (link)))
  • Edge runtime implementation reference: edge-vm.ts

Impact

This issue affects:

  • Next.js applications using edge runtime
  • Potentially other frameworks that rely on the Buffer File export
  • Any edge computing scenarios using Deno's Node.js compatibility layer

Additional Context

The missing export creates compatibility issues between Deno's Node.js polyfills and existing Node.js-based frameworks, particularly in edge computing scenarios where the File class is expected to be available.

@connerwit2006
Copy link

exactly this /\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants