Title: JS code update needed for sweetalert2
Last modified: December 28, 2021

---

# JS code update needed for sweetalert2

 *  Resolved [mihai01](https://wordpress.org/support/users/mihai01/)
 * (@mihai01)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/js-code-update-needed-for-sweetalert2/)
 * If the plugin is used together with another plugin (in my case, WP Cloudflare
   Super Page Cache) which uses a newer version of the ‘sweetalert2’ js library (
   11.0.18 for the mentioned plugin), WP htaccess editor won’t be able to Save or
   Save Test anymore, but it will throw the following JS errors:
 *     ```
       wp-htaccess-editor.js?ver=1.70:formatted:32 Uncaught TypeError: Class constructor rn cannot be invoked without 'new'
           at block_ui (wp-htaccess-editor.js?ver=1.70:formatted:32)
           at HTMLAnchorElement.<anonymous> (wp-htaccess-editor.js?ver=1.70:formatted:171)
           at HTMLAnchorElement.dispatch (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,hoverIntent,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.2:2)
           at HTMLAnchorElement.v.handle (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,hoverIntent,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.2:2)
       ```
   
 * A quick fix for this would be to use object instantiation with `new` in all the
   places where there is none currently, i.e. `tmp = new swal(` instead of `tmp 
   = swal(`. It might be also a matter of file/module import, I’m not sure about
   this.

Viewing 1 replies (of 1 total)

 *  Plugin Author [WebFactory](https://wordpress.org/support/users/webfactory/)
 * (@webfactory)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/js-code-update-needed-for-sweetalert2/#post-15200064)
 * I’ll look into this. But just from reading what you said I don’t see a reason
   why Cloudflare (or any other plugin) would need to load its JS on our page. That
   would mean it loads its JS on every single WP admin page which is a bad practice,
   to say the least. But, maybe it’s not that, I’ll have a look. And yes, we probably
   do need to put a new version of SWAL in 🙂

Viewing 1 replies (of 1 total)

The topic ‘JS code update needed for sweetalert2’ is closed to new replies.

 * ![](https://ps.w.org/wp-htaccess-editor/assets/icon-256x256.png?rev=2010639)
 * [Htaccess File Editor - Safely Edit Htaccess File](https://wordpress.org/plugins/wp-htaccess-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-htaccess-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-htaccess-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-htaccess-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-htaccess-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-htaccess-editor/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WebFactory](https://wordpress.org/support/users/webfactory/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/js-code-update-needed-for-sweetalert2/#post-15200064)
 * Status: resolved