You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this a problem caused by your code, or is it specifically because of the library?
I have double-checked my code carefully.
Describe the bug.
After build my node.js app with tsc, when trying to start the server running node dist/src/index.js, the following error is throw:
node_modules/whatsapp-web.js/index.d.ts:127:49 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
requestPairingCode(phoneNumber: string, showNotification = true): Promise<string>
I fix this typo error updating the method in my node_modules folder, changing this: requestPairingCode(phoneNumber: string, showNotification = true): Promise<string>
To this: requestPairingCode(phoneNumber: string, showNotification: boolean): Promise<string>
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is this a problem caused by your code, or is it specifically because of the library?
Describe the bug.
After build my node.js app with
tsc
, when trying to start the server runningnode dist/src/index.js
, the following error is throw:Code ref.:
https://github.com/pedroslopez/whatsapp-web.js/blob/main/index.d.ts#L127
Expected Behavior
requestPairingCode
method shoud be correcly declared.Because abstract functions cannot have function default parameters.
✅ Correct way:
requestPairingCode(phoneNumber: string, showNotification: boolean): Promise<string>
❌ Incorrect way:
requestPairingCode(phoneNumber: string, showNotification = true): Promise<string>
Steps to Reproduce the Bug or Issue
Run:
npm install whatsapp-web.js@v1.26.1-alpha.2
tsc
node dist/src/index.js
WhatsApp Account Type
Standard
Browser Type
Chromium
Operation System Type
Windows
Phone OS Type
iOS
WhatsApp-Web.js Version
1.26.1-alpha.2
WhatsApp Web Version
2.3000.1017054665
Node.js Version
22.0.0
Authentication Strategy
LocalAuth
Additional Context
I fix this typo error updating the method in my
node_modules
folder, changing this:requestPairingCode(phoneNumber: string, showNotification = true): Promise<string>
To this:
requestPairingCode(phoneNumber: string, showNotification: boolean): Promise<string>
The text was updated successfully, but these errors were encountered: