Skip to content

fix: import proto via createRequire, not ESM#89

Merged
gavrielc merged 1 commit into
mainfrom
fix/whatsapp-auth-proto-cjs
Apr 1, 2026
Merged

fix: import proto via createRequire, not ESM#89
gavrielc merged 1 commit into
mainfrom
fix/whatsapp-auth-proto-cjs

Conversation

@gavrielc

@gavrielc gavrielc commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • proto is not a named ESM export from Baileys 6.x (CJS module) — the ESM import crashes before the getPlatformId patch takes effect
  • Import proto via createRequire alongside the generics patch

Test plan

  • Pair a new device using pairing code — should connect without "couldn't link device" error

🤖 Generated with Claude Code

proto is not a named ESM export from Baileys 6.x (CJS module). The ESM
import crashes before the getPlatformId patch can take effect. Use
createRequire to get proto alongside the generics patch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gavrielc gavrielc requested a review from gabi-simons as a code owner April 1, 2026 10:02
@gavrielc gavrielc merged commit 3618945 into main Apr 1, 2026
1 of 2 checks passed
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