Closed olalonde closed 1 year ago
Describe the bug
SyntaxError: The requested module '@whiskeysockets/baileys' does not provide an export named 'proto'
To Reproduce
npm install @whiskeysockets/baileys
import { proto } from "@whiskeysockets/baileys";
tsc
Expected behavior No error.
Environment (please complete the following information): MacOS, typescript
Additional context
Trying to run the code in https://github.com/WhiskeySockets/Baileys/blob/master/Example/example.ts from a separate package.
use this please don't forget to mark as solved
import makeWASocket, { proto } from '@whiskeysockets/baileys'
This does not solve the issue.
tsx src/bin/bot.ts
/Users/redacted/code/myapp/src/bot/index.ts:9
import makeWASocket, { proto } from "@whiskeysockets/baileys";
^
SyntaxError: The requested module '@whiskeysockets/baileys' does not provide an export named 'proto'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:122:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:188:5)
at async CustomizedModuleLoader.import (node:internal/modules/esm/loader:228:24)
at async loadESM (node:internal/process/esm_loader:40:7)
at async handleMainPromise (node:internal/modules/run_main:66:12)
Node.js v20.5.0
This seems to work
import {
WAProto as proto,
} from "@whiskeysockets/baileys";
Describe the bug
To Reproduce
npm install @whiskeysockets/baileys
Expected behavior No error.
Environment (please complete the following information): MacOS, typescript
Additional context
Trying to run the code in https://github.com/WhiskeySockets/Baileys/blob/master/Example/example.ts from a separate package.