Base 5: The Unexpected End of a Script

While I was creating a theme for WordPress and got to editing the menu, I see that the menu does not work, so after checking the console log I notice that foundation.min.js has a problem with Unexpected end of script

What can cause this type of error:

Unexpected end of script

I read where he says, because you have no end }); but this is not my case since I am reloading foundation.min.js

This problem also interferes with another aspect of the foundation, and another error also occurs in the console log.

ReferenceError: Cannot find variable: Foundation

TypeError: undefined is not a function (evaluate to 'jQuery (document) .foundation ())

This issue also started when I started using AWS Cloudfront (but I doubt it could be a problem)

Image errors:

enter image description here

Base 5 Line Image Error:

enter image description here

+5
source share
2 answers

It is likely that the errors you see are caused by the way you include the javascript Foundation file in your html file and the place where you call .foundation () to use it.

Make sure you include js before any script that uses it. Make sure the version of jQuery you are using works with the version of the js flag you are using.

Check out another javascript that might have extra or missing brackets, which then fiddled with the base parsing script.

0
source

Since you are using Cloudfront, I assume that you are also using W3 Total Cache. It's right? I saw such problems when W3 Total Cache minimizes your Javascript.

Before tearing your hair, digging through foundation.min.js, I recommend eliminating a few things. I would first recommend disabling Cloudfront in W3 Total Cache. This eliminates the possibility of Cloudfront not saving the latest js.

Secondly, I would recommend checking js minify options in W3 Total Cache. Try turning this off and adjust the minimization algorithm.

0
source

Source: https://habr.com/ru/post/1213672/


All Articles