Skip to content

Gateway: link long for @whiskeysockets/baileys#77

Open
denis-vilantis wants to merge 1 commit intoopenclaw:mainfrom
denis-vilantis:fix/long-phantom-dep-baileys
Open

Gateway: link long for @whiskeysockets/baileys#77
denis-vilantis wants to merge 1 commit intoopenclaw:mainfrom
denis-vilantis:fix/long-phantom-dep-baileys

Conversation

@denis-vilantis
Copy link

Problem

@whiskeysockets/baileys@7.0.0-rc.9 has a static top-level ESM import in messages-recv.js:

```js
import Long from 'long'
```

But long is not declared in baileys' package.json dependencies. 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, and strip-ansi: find the package in the pnpm store and symlink it into baileys' virtual node_modules.

Related

Analogous to #45 (missing hasown).

@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.
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