#injected.js error

1 messages · Page 1 of 1 (latest)

tacit kernel
#

I am using desktop app using injected files to send before three days now

window.Store = Object.assign({}, window.mR.findModule(m => m.default && m.default.Chat)[0].default);

get this error:
javascript error: Cannot read properties of undefined (reading 'default')
(Session info: chrome=123.0.6312.59)

. Who can fix it please and how much cost?

tawdry sierra
#

This is a global error on the library because whatsapp changed the way of messaging, nothing can be done

tacit kernel
#

What is the new solution to send what's app messages

tawdry sierra
#

nothing so far

wicked escarp
#

You need to change the way modules are extracted, check this PR

https://github.com/pedroslopez/whatsapp-web.js/pull/2816#issuecomment-2039590314

Also check webpack-exodus branch from the library on github
https://github.com/pedroslopez/whatsapp-web.js/tree/webpack-exodus

You need to synch your injected.js file code with new code found within this branch and keep up to date until a stable release comes out

GitHub

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app - GitHub - pedroslopez/whatsapp-web.js at webpack-exodus

GitHub

PR Details

This PR adds support for Wwebjs past version 2.3000.x and 2.24..x. Send "F" in the chat for Webpack!
As always, very big thanks to my sponsors for their support! I am only abl...

wicked escarp
# tacit kernel I am using desktop app using injected files to send before three days now wi...

In the new version of whatsapp, many changes has been occured to modules that whatsapp uses:

  • bundler haas been changed from webpack to comet
  • Therefore the way of importing modules has been changed, and now we can directly use 'require' with the needed module instead of searching among all modules and their properties to find the needed module,
    so no need to use findModule anymore, just you need to know which module you are using and replace the findModule(...) by require('{module_name}'), if you check the PR or the branch i mentioned in previous command and check the content of 'src/util/Injected/Store.js', you will see what i mean
tacit kernel
#

Thank you so much