Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Injected.js #2827

Closed
wants to merge 6 commits into from

Conversation

allburov
Copy link

@allburov allburov commented Mar 21, 2024

PR Details

Add change to support WAWEB 2.3000 on injected.js and LocalWebCache.js
A bit different version from #2825 - it doesn't have long lines with all conditions inlined and uses ModuleFinder classes which we can create when there's new not supported changes in modules

Description

follow the WAWEB 2.3000 change on the function structure, and keep it useable with the old WAWEB version

Related Issue

Motivation and Context

How Has This Been Tested

Types of changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).

add for detecting WAWEB version 2.3000
remove console.log for debuging
@allburov allburov mentioned this pull request Mar 21, 2024
6 tasks
FranciscoJelou

This comment was marked as off-topic.

@marcelinopedro
Copy link

Hi, it stopped giving the error:

_node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34
const version = indexHtml.match(/manifest-([\d\.]+).json/)[1];
^

TypeError: Cannot read properties of null (reading '1')_

And the error started:

node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
at fillModuleArray (eval at (:46:5), :6:74)
at moduleRaid (eval at (:46:5), :15:3)
at puppeteer_evaluation_script:48:17

@allburov
Copy link
Author

Hi, it stopped giving the error:

What version of whatsapp web does it give and at which step?
I've tested it with 2.3000.1012140169 and 2.2411.2 - works fine

@maunklana
Copy link

Hi, it stopped giving the error:

_node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34 const version = indexHtml.match(/manifest-([\d.]+).json/)[1]; ^

TypeError: Cannot read properties of null (reading '1')_

And the error started:

node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push') at fillModuleArray (eval at (:46:5), :6:74) at moduleRaid (eval at (:46:5), :15:3) at puppeteer_evaluation_script:48:17

make sure u use this wwebjs/moduleRaid

@luiscuriel
Copy link

This fixes connection errors and the client starts ok, but I get this error when sending message:
window.Store.MsgKey is not a constructor

@marcelinopedro
Copy link

Boys and girls,
I speak from here in Brazil 🇧🇷

The problem was resolved perfectly due to these resolutions:
• wweb-js version: '2.2411.2'

• In src/util/constants.js to replace:
webVersionCache: {
type: 'remote',
remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html',
}

• And #2827

Thank you all for the attention!
Sincerely, Pedro Marcelino

@developer-abdul
Copy link

Just adding the parameter to webVersion with value '2.2411.2' is working fine on my end.

If I don't pass the parameter, I get TypeError: Cannot read properties of null (reading '1') error.

@vitorsilvalima
Copy link

vitorsilvalima commented Mar 24, 2024

I still receiving even after updating the injected.js and moduleraid scripts

error loading', error: ModuleError: Requiring module "%s" with unresolved dependencies: %s

@Har1ha
Copy link

Har1ha commented Mar 28, 2024

Boys and girls, I speak from here in Brazil 🇧🇷

The problem was resolved perfectly due to these resolutions: • wweb-js version: '2.2411.2'

• In src/util/constants.js to replace: webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html', }

• And #2827

Thank you all for the attention! Sincerely, Pedro Marcelino

can you please describe how you fixed it

@Har1ha
Copy link

Har1ha commented Mar 28, 2024

Hello a new error arose following your step please help
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'Call')

@Har1ha
Copy link

Har1ha commented Mar 29, 2024

Just adding the parameter to webVersion with value '2.2411.2' is working fine on my end.

If I don't pass the parameter, I get TypeError: Cannot read properties of null (reading '1') error.

where exactly did you pass the parameter when I set the webVersion in client parameter it does not change the version please help

@Ramon-Wong
Copy link

Boys and girls, I speak from here in Brazil 🇧🇷

The problem was resolved perfectly due to these resolutions: • wweb-js version: '2.2411.2'

• In src/util/constants.js to replace: webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html', }

• And #2827

Thank you all for the attention! Sincerely, Pedro Marcelino

HEY, Muito Obrigado!!
It works!

Copy link
Sponsor Collaborator

@PurpShell PurpShell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relies on client revision and patched moduleRaid (moduleRaid is to be gone soon)

@hazuer
Copy link

hazuer commented Apr 3, 2024

Boys and girls, I speak from here in Brazil 🇧🇷

The problem was resolved perfectly due to these resolutions: • wweb-js version: '2.2411.2'

• In src/util/constants.js to replace: webVersionCache: { type: 'remote', remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2410.1.html', }

• And #2827

Thank you all for the attention! Sincerely, Pedro Marcelino

It's Works, Thanks

@PurpShell
Copy link
Sponsor Collaborator

obsolete, follow main PR.

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.

None yet