Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda