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

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getProfilePicFull') #1356

Closed
1 task done
xanaxxx opened this issue Mar 26, 2022 · 26 comments
Labels
bug Something isn't working

Comments

@xanaxxx
Copy link

xanaxxx commented Mar 26, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

i get this error when the session try to initiate, i guess this can come from the function of read message unread idk, anybody knows how can i fix this?.

Expected behavior

when the session restore the bot must send message to all chats unread

Steps to Reproduce the Bug or Issue

1.execute the command: node ./myproject.js

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

i am actually using:

-ubuntu
-whatsapp web BETA

Additional context

No response

@xanaxxx xanaxxx added the bug Something isn't working label Mar 26, 2022
@vphelipe
Copy link

Yes, the function has changed. Now it's another.

@luiscuriel
Copy link

I think it is now called:
window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;

Just change this in Injected.js

@hamza-masoud
Copy link

I think it is now called: window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;

Just change this in Injected.js

just comment the line until the error fixed

@tomedmd
Copy link

tomedmd commented Mar 27, 2022

I think it is now called: window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;

Just change this in Injected.js

It works thanks!

@ItsMisa
Copy link

ItsMisa commented Mar 28, 2022

I think it is now called: window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;

Just change this in Injected.js

I change this in injected.js,but it still evaluation failed: Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getProfilePic')

@Yuri-Lima
Copy link

Yes, I have just got the same error.

errot

@d0v3riz
Copy link

d0v3riz commented Mar 28, 2022

same error here

@ItsMisa
Copy link

ItsMisa commented Mar 28, 2022

I think it is now called: window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;
Just change this in Injected.js

I change this in injected.js,but it still evaluation failed: Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getProfilePic')

it works when I update the latest version

@Yuri-Lima
Copy link

Yuri-Lima commented Mar 28, 2022

comment the line until the error fixe

Which version have you updated, by the way?

I am using "whatsapp-web.js": "^1.16.4",

@ItsMisa
Copy link

ItsMisa commented Mar 28, 2022

comment the line until the error fixe

Which version have you updated, by the way?

I am using "whatsapp-web.js": "^1.16.4",
1.16.4, I just excute npm i whatsapp-web.js

@luiscuriel
Copy link

luiscuriel commented Mar 28, 2022

My fix will work with latest version but will fail with previous versions. In case you want to be sure it won't fail, just comment the line as someone has suggested until we all have the latest whatsapp version...

@Yuri-Lima
Copy link

My fix will work with latest version but will fail with previous versions. In case you want to be sure it won't fail, just comment the line as someone has suggested until we all have the latest whatsapp version...

Man, I would say that most of the problems are not too relevant, however, if you wanna minimize some of them, keep all messages controlled by some third party like RabbitMQ..... If you do that, you will "guarantee" that messages will be delivered once the application is back to work.

Of course that you have to make sure to be notified when your app is down, so what I have done, is send messages to myself for each client, once I don't get any some of them, my status app send a pop-up notification, and send an email as well.

I have been using https://uptimerobot.com/

@JohnYepthomi
Copy link

My fix will work with latest version but will fail with previous versions. In case you want to be sure it won't fail, just comment the line as someone has suggested until we all have the latest whatsapp version...

Can you share your whatsapp version. I think i have the latest but still it doesn't work. I commented it out for the time being and it works but still want to know why it didnt work.

@ItsMisa
Copy link

ItsMisa commented Mar 28, 2022

My fix will work with latest version but will fail with previous versions. In case you want to be sure it won't fail, just comment the line as someone has suggested until we all have the latest whatsapp version...

Can you share your whatsapp version. I think i have the latest but still it doesn't work. I commented it out for the time being and it works but still want to know why it didnt work.

I think you can excute npm install whatsapp-web.js, not excute npm install the version in package.json. this is my version that can work.
image

@Yuri-Lima
Copy link

Yuri-Lima commented Mar 28, 2022

I think you can excute npm install whatsapp-web.js, not excute npm install the version in package.json. this is my version that can work.
Correction on your code:
NOT WORKING: window.Store.getProfilePicFull = window.mR.findModule('getProfilePic')[0].getProfilePic;
WORKING: window.Store.getProfilePicFull = window.mR.findModule('getProfilePicFull')[0].getProfilePic;

Yes, for while it has been working. @JohnYepthomi @ItsMisa Thanks

@AdrianoRobson
Copy link

I've tried all the solutions described above, but still getting a getProfilePic error when reading the qrcode!
I'm using "whatsapp-web.js": "version": "1.16.4",
multi-device disabled

Screenshot from 2022-03-28 21-14-06

@jtouris
Copy link
Contributor

jtouris commented Mar 29, 2022

Hi all,

I created a fix for this problem, here is the PR: #1362

Please test and let me know if the problem persists.

@lorenzoarellano
Copy link

Hi all,

I created a fix for this problem, here is the PR: #1362

Please test and let me know if the problem persists.

It is working, thank you so much!!!

@lorenzoarellano
Copy link

Well we have something in common here, Almost every week the library changes, how many of you guys have this bot in production?

I do.

@AdrianoRobson
Copy link

I do too

We certainly have something in common. Whatsapp-web.js and puppter always have a problem in production and I make use of this API. Too much headache.

For this case, I was able to resolve this by following this solution:
WhatsAppNETClient/WhatsAppNETClient2#26 (comment)

I thank the community for the help!

@jtouris
Copy link
Contributor

jtouris commented Mar 29, 2022

I do too

We certainly have something in common. Whatsapp-web.js and puppter always have a problem in production and I make use of this API. Too much headache.

For this case, I was able to resolve this by following this solution: WhatsAppNETClient/WhatsAppNETClient2#26 (comment)

I thank the community for the help!

That will not solve the problem. 'getProfilePic' will only avoid the initial error when loading the module in injected.js, but it does not work if u actually try to invoke the client's getProfilePicUrl() function, it will fail to retrieve the image.

Use my PR to solve this issue correctly #1362

@eabdala
Copy link

eabdala commented Mar 29, 2022

How can I extract these getProfilePic properties?

@pedroslopez
Copy link
Owner

Thanks for reporting the issue. The fix has now been released as part of v1.16.5. Please update for proper compatibility with the latest version of WhatsApp Web.

@Clement265
Copy link

Thanks for reporting the issue. The fix has now been released as part of v1.16.5. Please update for proper compatibility with the latest version of WhatsApp Web.

whatsapp web js v1.16.5. is it out?
can i update from v1.16.4 to v1.65.5

@hamza-masoud
Copy link

Thanks for reporting the issue. The fix has now been released as part of v1.16.5. Please update for proper compatibility with the latest version of WhatsApp Web.

whatsapp web js v1.16.5. is it out? can i update from v1.16.4 to v1.65.5

yap just run npm install whatsapp-web.js@latest

@AlexScigalszky
Copy link

Thanks for reporting the issue. The fix has now been released as part of v1.16.5. Please update for proper compatibility with the latest version of WhatsApp Web.

whatsapp web js v1.16.5. is it out? can i update from v1.16.4 to v1.65.5

yap just run npm install whatsapp-web.js@latest

It's works to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests