-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS error: Uncaught TypeError: Cannot set property 'popups' of undefined #635
Comments
@rkaiser0324 - Never seen this before in support, so unlikely its caused by the code on our end. That said the short answer, no it wouldn't be. If you read the if statement above that line it says, if the script hasn't already been rendered, localize it the normal way, if it has already been rendered assign a global variable (same as localizing), then clone that variable into the global pum_vars object. Since the cloning into the object only occurs if the pum-site-scripts are already loaded, that variable already exists, if we made the change you suggest we would overwrite all the variables already declared. IE this only runs if the window.pum_vars is already on the page in the first place. The only reason you would get that error is if your assets were not loading the normal way, IE are you using an optimization plugin that is combining them or moving them from footer to head etc. If so its telling WP its loaded, but not rendering it until after our code there gets rendered. In any case haven't seen any other reports of this in the forums or support, so were gonna have to treat it as a localized conflict which we can try to debug. That said you could change it to this which sets window.pum_vars to itself if it already exists, IE a sanity check. echo 'window.pum_vars = window.pum_vars || {}; window.pum_vars.popups = window.pum_popups;'; Also you could probably just comment it out as well as its only used for some of our older extensions to keep them compatible. |
@danieliser you were absolutely correct - this was caused by a minification plugin, namely BWP-Minify. Bypassing it avoids this JS error. Thanks for the explanation. |
Gonna add the change above just in case. |
Version tagged 1.7.30. Latest version of Chrome, 71.0.3578.98.
This is due to
late_localize_scripts()
- currently you haveShouldn't it be
Doesn't seem to affect popup display though.
The text was updated successfully, but these errors were encountered: