WordPress.org

Ready to get started?Download WordPress

Forums

MinQueue
MinQueue not working - Uncaught TypeError (6 posts)

  1. robertocmcosta
    Member
    Posted 10 months ago #

    Hi,

    I've just been introduced to your plugin. I decided to try it on a test site running on MAMP and it's failing to work with the following msg from the inspector (chrome):

    Uncaught TypeError: Cannot call method 'appendChild' of null

    Have I done anything wrong?

    http://wordpress.org/plugins/minqueue/

  2. Matthew Haines-Young
    Human Made
    Plugin Author

    Posted 10 months ago #

    Hi.

    This sounds like a bug. Where are you seeing this error - in the admin? Also does chrome give you a line number where this error occurred?

    Can you also check that you are not loading a custom version of jquery in the admin as this may cause problems.

    Hopefully we can get to the bottom of the problem.

  3. robertocmcosta
    Member
    Posted 10 months ago #

    Hi Matthews,

    First, thanks for taking the time to answer me. No, I'm on the front-end of the site. On the software side:
    wordpress' default jquery 1.10.2 loaded
    wordpress 3.7.1
    and a bunch of plugins.

    The full log in inspector is:
    Uncaught TypeError: Cannot call method 'appendChild' of null (index):472
    MinQueue.insertButton (index):472
    MinQueue.init (index):485
    (anonymous function) (index):493

    I can see minqueue scripts in those lines but nothing else happens. I mean I enabled the minification of styles putting in the handlers "style, formidablepro" to see the plugin in action. So far all I get is the error above.
    I also tried installing the plugin on the live site (server config different from MAMP) with the same results.

  4. Matthew Haines-Young
    Human Made
    Plugin Author

    Posted 10 months ago #

    Hi,

    Are you disabling the admin bar on the front end of the site? This is required to use the helper tool - although the actual minification proccess will work fine.

    However it shouldn't cause a JS error. I have made a fix if you get the latest version from github.

    Direct link to zip: https://github.com/mattheu/MinQueue/archive/master.zip

  5. robertocmcosta
    Member
    Posted 10 months ago #

    Now I don't see the error, but no minification yet.
    Maybe I'm the one to blame. The way I'm entering the style handles maybe wrong.
    I'm entering "style, formidablepro" in the Style minification queue(s) form. Is it right?
    I also tried entering "jquery, utilities (a custom script)" in the Script minification queue(s) and it works (scripts only)! A file named ​minqueue-349ff3a7-cb2d6813.js is called. However jquery.js is being loaded separately. Shouldn't it disappear since it's included in the minified version?
    As for the styles, do I have to enter style names in another way to make it work?

  6. Matthew Haines-Young
    Human Made
    Plugin Author

    Posted 10 months ago #

    The names are just the handles that were used when enqueuing the scripts.

    RE JQuery - if you are adding the handle to the list of scripts, it should be processed. Note that the handle used by jquery that is bundled with WordPress is jquery-core - it also loads jquery-migrate. I usually minify both.

    Check the generated file - the handles for scripts that are enqueued in it are displayed at the top of the file in a comment. Is jQuery added here?

    Also confirm that there isn't 2 copies of jQuery being loaded. Sometimes plugins do not always load it correctly.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.