• Resolved mikejsnowplow

    (@mikejsnowplow)


    I was using this on a single instance site, and we’ve recently migrated over to a multisite set-up.

    Now when I go into the plugin settings, I’m presented with a largely blank page, other than the three tabs at the top.

    I think this is due to a JS issue it’s throwing, though I’m not sure why it’s throwing it.

    The error is:

    Uncaught ReferenceError: wsAmeLodash is not defined

    And the line it throws it on is:

    AmeActorManager._ = wsAmeLodash;

    Any pointers as to how I might resolve this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    It sounds like one of the plugin scripts is either missing or not being loaded for some reason. Please verify that this file exists and isn’t empty:
    /wp-content/plugins/admin-menu-editor/js/lodash.min.js

    If the file isn’t there, I would recommend reinstalling the plugin. Alternatively, you could manually download the plugin, extract the specific file from the ZIP archive, and upload it to the above location.

    If the file looks fine, maybe it doesn’t get loaded. Please take a look at the source code of the plugin settings page and search it for mentions of lodash.min.js. Are there any results? Perhaps the file is there but it’s being loaded from another plugin’s directory?

    Finally, there is a specific line of code that needs to be run just after loading the aforementioned JS file. See if there is code like this in the page source code (it should be just below the line that loads lodash.min.js):
    <script type="text/javascript">wsAmeLodash = _.noConflict();</script>

    If the page loads lodash.min.js but does not include the above code, that could be a sign that there’s some previously unknown bug or plugin/theme conflict.

    Thread Starter mikejsnowplow

    (@mikejsnowplow)

    Hi Janis

    Thanks for the prompt reply – once I’ve had the chance to try the steps above I’ll let you know which, if any, worked.

    Thanks
    Mike

    Thread Starter mikejsnowplow

    (@mikejsnowplow)

    If the page loads lodash.min.js but does not include the above code, that could be a sign that there’s some previously unknown bug or plugin/theme conflict.

    I think this might be the issue. The JS is being loaded in but I can’t spot the code above.

    It looks like our host is automatically minifying the JS into a single bundle, so I can’t actually see the line where the file gets loaded in, instead I can find it in the Network Resource tab of Dev Tools within a file called build.min.js

    I imagine this is what’s causing the issues and that a workaround might be difficult.

    Can I add that line in manually perhaps?

    Plugin Author Janis Elsts

    (@whiteshadow)

    Adding the line manually could work. It’s not a sure thing because that code needs to run before any other scripts that use the _ variable. If you have a bunch of scripts bundled into one, running the code after the whole bundle has already been loaded might be too late. Still, it’s worth a try.

    Thread Starter mikejsnowplow

    (@mikejsnowplow)

    Yea…it didn’t work as you’ve predicted 🙂

    I’ve been working with support at our host and they’ve talked me through how to exclude certain scripts from concatenating, which was the issue, so all resolved now.

    Thanks for the support.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘JS issue prevents loading’ is closed to new replies.