Skip to content

fix: remove neonConfig WebSocket override for Bun+Docker compatibility - #881

Merged
AmanVarshney01 merged 1 commit into
mainfrom
fix/neon-bun-websocket-docker
Feb 12, 2026
Merged

AmanVarshney01 merged 1 commit into
mainfrom
fix/neon-bun-websocket-docker

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Feb 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Addresses #879 - Bun runtime + Prisma Neon adapter: WebSocket constructor override causes production failure in Docker.

Problem

Using neonConfig.webSocketConstructor = ws (Node's ws library) in a Bun environment caused Unexpected server response: 101 in Docker. Forcing Node's ws implementation inside Bun runtime caused protocol upgrade mismatches in containerized environments.

Solution

  • Drizzle: Remove all neonConfig. Use Neon HTTP driver (neon-http) with neon() + drizzle() only - uses fetch by default, no WebSocket required.
  • Prisma (Node/Bun): Remove neonConfig entirely. Use PrismaNeon adapter without config - driver auto-detects runtime.
  • Prisma (Workers): Keep poolQueryViaFetch = true for edge runtime.
  • Dependencies: Remove ws and @types/ws from Neon setup (both Prisma and Drizzle).

Aligns with official Neon Drizzle docs and Neon Prisma docs.

Made with Cursor

Summary by CodeRabbit

  • Chores
    • Removed WebSocket support and the "ws" package dependency from Neon PostgreSQL database configurations in both Prisma and Drizzle ORM template generation
    • Eliminated WebSocket constructor assignments and edge-fetch pool query optimization configurations from Neon adapter initialization
    • Simplified database template initialization by using Neon serverless adapter in its default configuration without explicit overrides

- Remove webSocketConstructor = ws override that caused 'Unexpected server
  response: 101' in Bun runtime when deployed to Docker
- Align with official Neon docs: use HTTP driver for Drizzle (no config)
- Use PrismaNeon adapter without neonConfig for Node/Bun
- Keep poolQueryViaFetch for Prisma Workers (edge runtime)
- Remove ws and @types/ws from Neon dependencies

Fixes #879

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-better-t-stack-web Ready Ready Preview, Comment Feb 12, 2026 6:08pm

Request Review

@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR removes websocket ("ws") dependency wiring and neonConfig customization from Neon-related PostgreSQL setups across Prisma and Drizzle integrations. The changes eliminate websocket constructor assignments and edge-fetch pooling configurations while maintaining the core Neon serverless adapter functionality.

Changes

Cohort / File(s) Summary
Dependency Configuration
packages/template-generator/src/processors/db-deps.ts
Removes "ws" and "@types/ws" dependencies from processPrismaDeps and processDrizzleDeps for PostgreSQL with neon dbSetup, while retaining Neon adapter packages.
Template Code Generation
packages/template-generator/src/templates.generated.ts
Removes neonConfig imports and websocket constructor assignments from generated template code, eliminating edge-fetch poolQueryViaFetch configurations.
Drizzle Template
packages/template-generator/templates/db/drizzle/postgres/src/index.ts.hbs
Removes neonConfig and ws imports and related configuration assignments; retains neon adapter initialization without config customization.
Prisma Template
packages/template-generator/templates/db/prisma/postgres/src/index.ts.hbs
Removes neonConfig and ws imports and websocket/fetch pool configuration assignments; retains PrismaNeon adapter initialization.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: removing neonConfig WebSocket overrides for Bun+Docker compatibility, which is the core fix across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AmanVarshney01
AmanVarshney01 merged commit d9f6bcc into main Feb 12, 2026
3 checks passed
@AmanVarshney01
AmanVarshney01 deleted the fix/neon-bun-websocket-docker branch February 12, 2026 19:24

This branch was successfully deployed

1 active deployment
Preview — 8b611fca Deployed Feb 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant