gmail.get.email_data failing for some reason
See original GitHub issueI believe I found a bug but want to make sure my code is correct.
gmail.observe.on('view_thread', () => {
const emailData = gmail.get.email_data()
console.log(`${emailData}`)
})
Based on the documentation I believe that when I click an email thread, emailData should return an object which contains data about the email.
When I click an email thread the code executes at the proper time. Unfortunately I get the following in the console. The GET seems to be receiving an undefined param which results in an erroneous response format. The behavior is the same even if I move lines 2-3 out of the observer.

Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
Gmail won't load - Gmail Help - Google Support
If Gmail is slow or isn't loading correctly, use the steps below to fix the problem. Step 1: Check that you're using a...
Read more >Why is My Gmail Not Receiving Emails? - RightInbox
Gmail not receiving emails? It's more common then you think. Thankfully there is more often than not a quick fix. Here's some of...
Read more >api.new.get.email_data is giving null. · Issue #558 - GitHub
Earlier I was using api.get.email_data to get email data. ... I specifically see in the README that Gmail-js is not working as a ......
Read more >Gmail Attachment Failed: 4 Easy Methods to Fix This Issue
Easy steps to get the Gmail attachment working again · Why is my attachment failing in Gmail? · How can I fix Gmail...
Read more >Common Gmail Problems and How to Solve Them - Mailbird
... because Gmail's not working? See some simple ways of solving the most common Gmail issues. ... Other Reasons Why Gmail Is Not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had the same error. Just Update your gmail.js file.
As discussed to great lengths in a previous issue, google has effectively obsoleted all XHR-based APIs we’ve used in the past. This particularly includes anything related to gmail.get.email_data().
Now it’s 2019 and it should be considered fundamentally broken.
Consider replacing all use of gmail.get.email_data() with gmail.new.get.email_data().
Please note data-format differs, it has some limitations and it’s not a simple drop-in replacement.