Gateway: link long for @whiskeysockets/baileys#77
Open
denis-vilantis wants to merge 1 commit intoopenclaw:mainfrom
Open
Gateway: link long for @whiskeysockets/baileys#77denis-vilantis wants to merge 1 commit intoopenclaw:mainfrom
denis-vilantis wants to merge 1 commit intoopenclaw:mainfrom
Conversation
@whiskeysockets/baileys@7.0.0-rc.9 imports 'long' as a top-level static ESM import in messages-recv.js but does not declare it in package.json. pnpm strict mode therefore never creates the symlink in baileys' virtual node_modules directory, causing ERR_MODULE_NOT_FOUND at startup when a Telegram channel is configured. This follows the same pattern already used for combined-stream, hasown, and strip-ansi in this script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
@whiskeysockets/baileys@7.0.0-rc.9has a static top-level ESM import inmessages-recv.js:```js
import Long from 'long'
```
But
longis not declared in baileys'package.jsondependencies. pnpm strict mode therefore never creates the symlink in baileys' virtual node_modules directory. This causes a hard crash at startup when a Telegram channel is configured:```
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'long' imported from
.../node_modules/.pnpm/@WhiskeySockets+baileys@7.0.0-rc.9.../node_modules/@whiskeysockets/baileys/lib/Socket/messages-recv.js
```
The crash is silent to the vitest suite (gateway-tests only run unit tests, never open a real Telegram socket), so CI passes while real deployments fail.
Fix
Follows the exact same pattern already used in this script for
combined-stream,hasown, andstrip-ansi: find the package in the pnpm store and symlink it into baileys' virtual node_modules.Related
Analogous to #45 (missing
hasown).