Title: Combine JavaScript Files conflicts with PDF Embedder
Last modified: February 3, 2021

---

# Combine JavaScript Files conflicts with PDF Embedder

 *  Resolved [craftbilt](https://wordpress.org/support/users/craftbilt/)
 * (@craftbilt)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/combine-javascript-files-conflicts-with-pdf-embedder/)
 * Hi there,
    When the “Combine JavaScript Files” option is activated on the SG 
   optimizer, the PDF embedder plugin is not functioning and throwing the error 
   below. I have added the following code to functions.php to exclude it, but still
   getting the error. Right now, the “Combine JavaScript Files” is not active, and
   the PDF is working on the following URL.
 * [https://craft-bilt.com/catalogue/](https://craft-bilt.com/catalogue/)
 * PS. Even when I use the “excluding URL” option, still gives the same error.
    
   Did I miss anything during the implementation? Please let me know. Thanks
 * Error:
    “Setting up fake worker failed: “Cannot load script at: [https://craft-bilt.com/wp-content/uploads/siteground-optimizer-assets/siteground-optimizer-combined-js-cb937f7701612535bf71c597ee663506.worker.js&#8221](https://craft-bilt.com/wp-content/uploads/siteground-optimizer-assets/siteground-optimizer-combined-js-cb937f7701612535bf71c597ee663506.worker.js&#8221);.”
 * **********************************************************************************************************
 * add_filter( ‘sgo_javascript_combine_exclude’, ‘js_combine_exclude’ );
    function
   js_combine_exclude( $exclude_list ) { $exclude_list[] = ‘pdfemb_embed_pdf_js 
   and pdfemb_pdf_js’;
 *  return $exclude_list;
    }
 * add_filter( ‘sgo_js_minify_exclude’, ‘js_minify_exclude’ );
    function js_minify_exclude(
   $exclude_list ) { $exclude_list[] = ‘pdfemb_embed_pdf_js and pdfemb_pdf_js’;
 *  return $exclude_list;
    }
 * add_filter( ‘sgo_css_combine_exclude’, ‘css_combine_exclude’ );
    function css_combine_exclude(
   $exclude_list ) { // Add the style handle to exclude list. $exclude_list[] = ‘
   pdfemb_embed_pdf_css’;
 *  return $exclude_list;
    }
 * add_filter( ‘sgo_css_minify_exclude’, ‘css_minify_exclude’ );
    function css_minify_exclude(
   $exclude_list ) { // Add the style handle to exclude list. $exclude_list[] = ‘
   pdfemb_embed_pdf_css’;
 *  return $exclude_list;
    }

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

 *  Plugin Author [Stoyan Georgiev](https://wordpress.org/support/users/stoyangeorgiev/)
 * (@stoyangeorgiev)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/combine-javascript-files-conflicts-with-pdf-embedder/#post-14000912)
 * Hello there [@craftbilt](https://wordpress.org/support/users/craftbilt/),
 * You excluded from the combination incorrect. You just have to make a new line
   for every script you wish to exclude. You can use this one, it will solve the
   issue.
 * Simply change the first to filters like this
 *     ```
       add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
       function js_combine_exclude( $exclude_list ) {
       	$exclude_list[] = 'pdfemb_embed_pdf_js';
       	$exclude_list[] = 'pdfemb_pdf_js';
   
       	return $exclude_list;
       }
   
       add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
       function js_minify_exclude( $exclude_list ) {
       	$exclude_list[] = 'pdfemb_embed_pdf_js';
       	$exclude_list[] = 'pdfemb_pdf_js';
   
       	return $exclude_list;
       }
       ```
   
 * After that enable the JS Combination and everything should be working as expected.
   
   If you have any issues feel free to reach back to us.
 * Kind regards,
    Stoyan
 *  Thread Starter [craftbilt](https://wordpress.org/support/users/craftbilt/)
 * (@craftbilt)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/combine-javascript-files-conflicts-with-pdf-embedder/#post-14002556)
 * Thanks. It worked. I didn’t see “and” 🙂
 *  [cultedigital](https://wordpress.org/support/users/cultedigital/)
 * (@cultedigital)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/combine-javascript-files-conflicts-with-pdf-embedder/#post-14145378)
 * Thank you! Worked for me too 🙂

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

The topic ‘Combine JavaScript Files conflicts with PDF Embedder’ is closed to new
replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [cultedigital](https://wordpress.org/support/users/cultedigital/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/combine-javascript-files-conflicts-with-pdf-embedder/#post-14145378)
 * Status: resolved