Calling postMessage in Web Worker onmessage callback throws SYNTAX_ERR: DOM Exception 12
-
29-10-2019 - |
Pergunta
When writing the onmessage callback for a Web Worker I get an "Uncaught Error: SYNTAX_ERR: DOM Exception 12" in my console when I try to send another postMessage().
var w = new Worker(url);
w.onmessage = function(e) {
if(e.data.msg=='validate'){
if(validateWork(e.data.wrk)){
postMessage('proceed');
}
}
}
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow