jacobwb / hashover-next

This branch will be HashOver 2.0
GNU Affero General Public License v3.0
419 stars 87 forks source link

"TypeError: hashover is null" with default configuration #287

Closed Julianoe closed 4 years ago

Julianoe commented 4 years ago

I'm trying to use hashover-next with Jekyll (testing on PHP7.4.5). I tried to do the default simple automatic setup by adding

<script type="text/javascript" src="/hashover/comments.php"></script>

to my \<head> but it returns an error in the js console: TypeError: hashover is null.

I'm trying to understand why i can't get it to work this way but when i add the following to the \<head>, it works

<script type="text/javascript" src="/hashover/loader.php"></script> 

<link rel="stylesheet" type="text/css" href="/hashover/themes/default/comments.css"> 

<script type="text/javascript">
   var hashover = new HashOver ();
</script> 

Did i miss something? Did i misunderstand an instruction? (the second option does not really work, but i have a separate issue, can't manage to install php-intl)

jacobwb commented 4 years ago

It shouldn't matter where you place the script tag, but not having php-intl would be a problem.

Do you have a public page using HashOver that I can visit to investigate the issue?

Julianoe commented 4 years ago

Ok so i solved my intl problem (i had a badly installed module). Note that the console log "TypeError: hashover is null" seems to be hiding a different error then, indicating that the module is not available, which i installed correctly now.

I have a new error though SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Julianoe commented 4 years ago

When watching the errors in the PHP errors i saw that it was a duplicate of https://github.com/jacobwb/hashover-next/issues/281

Once updated to the latest hashover version and with intl properly installed, it seems to work on PHP 7.4.5 Thanks !