nextjs - ✅(Solved) Fix Docs: Does Edge Runtime support `Buffer`? [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86281Fetched 2026-04-08 02:11:43
View on GitHub
Comments
3
Participants
3
Timeline
12
Reactions
0
Author
Assignees
Timeline (top)
commented ×3mentioned ×3subscribed ×3assigned ×1

PR fix notes

PR #3: Develop

Description (problem / solution / changelog)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • New Features

    • Arabic/English internationalization with RTL support
    • Patient and doctor portals with dedicated dashboards
    • Appointment booking with doctor availability and slot management
    • Doctor profile, schedule management, and searchable listings
    • Medical records CRUD and document attachments
    • Video consultations with in-call chat
    • Localized auth flows: register, login, forgot/reset password
  • Improvements

    • Redesigned, localized UI and navigation; improved i18n routing and layout
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • .gitignore (modified, +4/-1)
  • backend/app/api/v1/appointments.py (added, +311/-0)
  • backend/app/api/v1/deps.py (added, +35/-0)
  • backend/app/api/v1/doctors.py (added, +286/-0)
  • backend/app/api/v1/patients.py (added, +62/-0)
  • backend/app/api/v1/records.py (added, +290/-0)
  • backend/app/api/v1/router.py (removed, +0/-0)
  • backend/app/api/v1/routes/appointments.py (removed, +0/-18)
  • backend/app/api/v1/routes/auth.py (removed, +0/-71)
  • backend/app/api/v1/routes/doctors.py (removed, +0/-18)
  • backend/app/api/v1/routes/patients.py (removed, +0/-18)
  • backend/app/app.py (modified, +16/-4)
  • backend/app/core/config.py (modified, +17/-4)
  • backend/app/core/database.py (modified, +93/-0)
  • backend/app/core/encryption.py (added, +17/-0)
  • backend/app/core/security.py (modified, +30/-18)
  • backend/app/db/__init__.py (renamed, +0/-0)
  • backend/app/db/session.py (modified, +2/-10)
  • backend/app/middleware/__init__.py (renamed, +0/-0)
  • backend/app/middleware/logging.py (added, +36/-0)
  • backend/app/models/__init__.py (added, +27/-0)
  • backend/app/models/appointment.py (added, +54/-0)
  • backend/app/models/audit_log.py (added, +22/-0)
  • backend/app/models/doctor.py (added, +76/-0)
  • backend/app/models/enums.py (added, +26/-0)
  • backend/app/models/medical_record.py (added, +72/-0)
  • backend/app/models/messaging.py (added, +50/-0)
  • backend/app/models/notification.py (added, +20/-0)
  • backend/app/models/patient.py (added, +40/-0)
  • backend/app/models/user.py (added, +44/-0)
  • backend/app/schemas/__init__.py (added, +85/-0)
  • backend/app/schemas/appointment.py (added, +61/-0)
  • backend/app/schemas/doctor.py (added, +108/-0)
  • backend/app/schemas/medical_record.py (added, +79/-0)
  • backend/app/schemas/messaging.py (added, +44/-0)
  • backend/app/schemas/notification.py (added, +25/-0)
  • backend/app/schemas/patient.py (added, +46/-0)
  • backend/app/schemas/user.py (added, +7/-0)
  • backend/pyproject.toml (modified, +4/-3)
  • backend/tests/conftest.py (added, +42/-0)
  • backend/tests/test_auth.py (modified, +6/-10)
  • backend/tests/test_doctors.py (added, +80/-0)
  • backend/uv.lock (modified, +2/-4)
  • docker-compose.yml (removed, +0/-0)
  • frontend/Dockerfile (removed, +0/-0)
  • frontend/README.md (removed, +0/-36)
  • frontend/messages/ar.json (added, +469/-0)
  • frontend/messages/en.json (modified, +466/-26)
  • frontend/package.json (modified, +4/-1)
  • frontend/pnpm-lock.yaml (modified, +188/-2)
  • frontend/src/app/[locale]/(auth)/sign-in/page.tsx (removed, +0/-67)
  • frontend/src/app/[locale]/(auth)/sign-up/page.tsx (removed, +0/-93)
  • frontend/src/app/[locale]/(portal)/doctor/dashboard/page.tsx (added, +376/-0)
  • frontend/src/app/[locale]/(portal)/doctor/layout.tsx (added, +53/-0)
  • frontend/src/app/[locale]/(portal)/doctor/loading.tsx (added, +27/-0)
  • frontend/src/app/[locale]/(portal)/doctor/profile/page.tsx (added, +225/-0)
  • frontend/src/app/[locale]/(portal)/doctor/records/page.tsx (added, +206/-0)
  • frontend/src/app/[locale]/(portal)/doctor/schedule/page.tsx (added, +325/-0)
  • frontend/src/app/[locale]/(portal)/patient/appointments/[id]/page.tsx (added, +266/-0)
  • frontend/src/app/[locale]/(portal)/patient/appointments/new/page.tsx (added, +385/-0)
  • frontend/src/app/[locale]/(portal)/patient/appointments/page.tsx (added, +266/-0)
  • frontend/src/app/[locale]/(portal)/patient/dashboard/page.tsx (added, +327/-0)
  • frontend/src/app/[locale]/(portal)/patient/layout.tsx (added, +53/-0)
  • frontend/src/app/[locale]/(portal)/patient/loading.tsx (added, +26/-0)
  • frontend/src/app/[locale]/(portal)/patient/profile/page.tsx (added, +243/-0)
  • frontend/src/app/[locale]/(portal)/patient/records/page.tsx (added, +213/-0)
  • frontend/src/app/[locale]/(public)/(auth)/forgot-password/page.tsx (added, +115/-0)
  • frontend/src/app/[locale]/(public)/(auth)/loading.tsx (added, +26/-0)
  • frontend/src/app/[locale]/(public)/(auth)/login/page.tsx (added, +14/-0)
  • frontend/src/app/[locale]/(public)/(auth)/register/page.tsx (added, +11/-0)
  • frontend/src/app/[locale]/(public)/(auth)/reset-password/page.tsx (added, +177/-0)
  • frontend/src/app/[locale]/(public)/consultation/[roomId]/page.tsx (added, +197/-0)
  • frontend/src/app/[locale]/(public)/doctors/[id]/page.tsx (added, +253/-0)
  • frontend/src/app/[locale]/(public)/doctors/loading.tsx (added, +41/-0)
  • frontend/src/app/[locale]/(public)/doctors/page.tsx (added, +205/-0)
  • frontend/src/app/[locale]/(public)/layout.tsx (added, +97/-0)
  • frontend/src/app/[locale]/(public)/not-found.tsx (added, +56/-0)
  • frontend/src/app/[locale]/(public)/page.tsx (added, +308/-0)
  • frontend/src/app/[locale]/dashboard/[role]/layout.tsx (removed, +0/-17)
  • frontend/src/app/[locale]/layout.tsx (modified, +19/-9)
  • frontend/src/app/[locale]/page.tsx (removed, +0/-65)
  • frontend/src/app/api/auth/register/route.ts (added, +119/-0)
  • frontend/src/app/globals.css (modified, +16/-15)
  • frontend/src/app/page.tsx (added, +6/-0)
  • frontend/src/components/DashboardHeader.tsx (added, +134/-0)
  • frontend/src/components/Logo.tsx (added, +6/-0)
  • frontend/src/components/Navbar.tsx (modified, +84/-46)
  • frontend/src/components/Sidebar.tsx (modified, +110/-26)
  • frontend/src/components/appointments/StatusBadge.tsx (added, +37/-0)
  • frontend/src/components/auth/ProtectedRoute.tsx (added, +44/-0)
  • frontend/src/components/auth/SignInForm.tsx (added, +166/-0)
  • frontend/src/components/auth/SignUpForm.tsx (added, +222/-0)
  • frontend/src/components/common/ErrorBoundary.tsx (added, +60/-0)
  • frontend/src/components/common/LanguageSwitcher.tsx (added, +43/-0)
  • frontend/src/components/common/LoadingSpinner.tsx (added, +28/-0)
  • frontend/src/components/ui/avatar.tsx (added, +109/-0)
  • frontend/src/components/ui/badge.tsx (added, +37/-0)
  • frontend/src/components/ui/card.tsx (added, +78/-0)
  • frontend/src/components/ui/checkbox.tsx (added, +29/-0)
  • frontend/src/components/ui/dialog.tsx (added, +160/-0)

Code Example

const nonce = Buffer.from(crypto.randomUUID()).toString('base64')
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

https://nextjs.org/docs/pages/api-reference/edge According to the Edge Runtime documentation, Buffer is not listed in the supported APIs. However, based on our testing, Buffer appears to be supported and works without errors.

Is there any context that might help us understand?

I'm using Next.js v15.x and Pages Router.

I tried to implement Content Security Policy (CSP). So I added the nonce by following the document: https://nextjs.org/docs/15/pages/guides/content-security-policy#nonces

In the sample code, it uses Buffer.

const nonce = Buffer.from(crypto.randomUUID()).toString('base64')

But in the document about middleware, "Middleware defaults to using the Edge runtime". https://nextjs.org/docs/15/app/api-reference/file-conventions/middleware#runtime

And I couldn't find Buffer in the supported APIs https://nextjs.org/docs/pages/api-reference/edge

However, as long as I deployed and tested, it worked without errors. Does it mean I can use Buffer in Edge Runtime?

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/pages/api-reference/edge

extent analysis

TL;DR

The issue can be resolved by verifying the support of Buffer in Edge Runtime through official documentation or testing, as it appears to work despite not being listed in the supported APIs.

Guidance

  • Review the Edge Runtime documentation to confirm if Buffer is supported, as the current documentation does not explicitly list it.
  • Test the usage of Buffer in a controlled environment to verify its functionality and potential errors.
  • Consider reaching out to the Next.js community or support for clarification on the support of Buffer in Edge Runtime.
  • If Buffer is not supported, explore alternative APIs or methods for achieving the desired functionality.

Example

// Alternative to Buffer for generating a nonce
const nonce = crypto.randomUUID();

Notes

The solution assumes that the Edge Runtime documentation is up-to-date and accurate. However, the fact that Buffer works despite not being listed suggests a potential discrepancy between the documentation and the actual implementation.

Recommendation

Apply workaround: Use Buffer with caution and thorough testing, as it appears to work despite not being explicitly supported in the Edge Runtime documentation. This approach allows for the continued use of Buffer while acknowledging the potential for future changes or issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING