Uncaught SyntaxError: Invalid or unexpected token

k.kwasniewski's picture

Hi

After transfering into new server I find that problem. Mbstring in active.

Wordpress version 5.1.1

Php version 7.2.4

I switch all plugins off and change theme on default

In Google Chrome console I see that screencast:

Uncaught SyntaxError: Invalid or unexpected token

h5p-data-views.js?ver=1.13.1:66 Uncaught TypeError: $ is not a function

at h5p-data-views.js?ver=1.13.1:66

at h5p-data-views.js?ver=1.13.1:82

Do you have any idea what could be the reason?

BR

Krzysztof

icc's picture

It appears that for some reason the script called jquery.js is not being loaded, or is being loaded in the wrong order. Can you locate the script tag with this script in your browser's if you right click and choose Inspect Element? 
You could also have a look in the Network tab to see the order of which the .js scripts are being loaded.

icc's picture

Maybe the file has been corrupted. Could you try expanding the first error you're seeing? (jquery.js)
Also, try downloading the file again from here: https://raw.githubusercontent.com/h5p/h5p-php-library/master/js/jquery.js

There is also a very small chance there may be a collision with another plugin or a browser extension. You should check in another browser as well.

k.kwasniewski's picture

I upload all plugin file manually by ftp and problem is solved

BR

Krzysztof

BV52's picture

Hi Krzysztof,

I'm glad you got it working and thank you for getting back to us with the solution.

-BV52