Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
How to solve 'No Matching Signature' error in chrome messaging API?

I'm making a simple chrome extension and I ran into this error. I've tried looking around to and the most I've found is that I'm likely running into an error with the parameters of the chrome.tabs.sendMessage. I tried console.log(tab[0].id) and it is in fact an integer. The docs say the message param can be a string and the other two params are optional and not needed in this context.

Uncaught (in promise) TypeError: Error in invocation of tabs.sendMessage(integer tabId, any 
message, optional object options, optional function callback): No matching signature.
at background.js:18:21

Here's my code:

chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({
    "title": 'Help With PIM',
    "id": 'pimhelper',
    "contexts": ['all'],
});

});

chrome.contextMenus.onClicked.addListener(async (info) => { if (info.menuItemId === "pimhelper") {

    let queryOptions = { active: true, currentWindow: true };
    let tab = await chrome.tabs.query(queryOptions);

    chrome.tabs.sendMessage((tab[0].id, '"message"'))
}

});

Possible ideas:

There might be something wrong with the message param and I read something about data serialization on the docs. Not sure how to use the JSON parse or stringify methods to solve this however.

I apologize if this is some noob mistake. I am entirely new to creating chrome extensions.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!