Closed sapyx closed 4 years ago
Looks like an issue with selectors. Please post your HTML, too.
This is an excerpt from HTML, which is very long. I don't know if I had said it before but in the end the result is perfect. Only this error message appears in the console. By performing a debug, the error occurs first and, afterwards, the procedure is repeated and completed correctly.
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
</head>
<body>
<main>
<div class="pure-g">
<div id="colonna-testo" class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3 colonne">
<article>
<section>
<h2>Introduzione</h2>
<h3>Accesso a uno spazio potenzialmente infinito...</h3>
<p>Internet da circa un decennio, sebbene con fasi alterne e con differenze da sottile a
macroscopiche, è diventato casa di un numero incalcolabile di pubblicazioni.</p>
</section>
</article>
</div>
</div>
</main>
</body>
i forgot to say that i am using paged.js and an old version of Hyphenopoly (provided in an example of paged.js) works perfectly.
After further investigation, I can confirm that the error does not always happen, but in a random way (by continuing to reload the page), and it is never blocking.
I think I found the problem. If the .wasm-engine is loaded before the DOM is ready, Hyphenopoly tries to hyphenate the elements of the specified language, but these elements aren't loaded, yet. So it produces that error message. Later, when the DOM is ready, Hyphenopoly collects the elements and hyphenates them.
paged.js delays DOM-readyness. I haven't covered this case in my tests, yet 🤦♂️
Browser: Google Chrome 81.0.4044.138
but the hypenation is correct.