woocommerce / storefront

Official theme for WooCommerce
https://wordpress.org/themes/storefront/
959 stars 472 forks source link

4.5.6 release does not include minified JS files (regression from 4.5.5 release) #2148

Closed rdj closed 1 month ago

rdj commented 1 month ago

Seeing 404 in my production environment which updated to Storefront 4.5.6.

Downloaded the 4.5.5 and 4.5.6 zip files locally, and the minified files are simply missing from the 4.5.6 zip:

$ find . -iname \*.js
./storefront-4.5.5/assets/js/woocommerce/header-cart.js
./storefront-4.5.5/assets/js/woocommerce/extensions/brands.min.js
./storefront-4.5.5/assets/js/woocommerce/extensions/brands.js
./storefront-4.5.5/assets/js/woocommerce/header-cart.min.js
./storefront-4.5.5/assets/js/sticky-add-to-cart.min.js
./storefront-4.5.5/assets/js/homepage.min.js
./storefront-4.5.5/assets/js/sticky-add-to-cart.js
./storefront-4.5.5/assets/js/admin/customizer.min.js
./storefront-4.5.5/assets/js/admin/plugin-install.min.js
./storefront-4.5.5/assets/js/admin/plugin-install.js
./storefront-4.5.5/assets/js/admin/customizer.js
./storefront-4.5.5/assets/js/admin/admin.min.js
./storefront-4.5.5/assets/js/admin/admin.js
./storefront-4.5.5/assets/js/footer.min.js
./storefront-4.5.5/assets/js/navigation.js
./storefront-4.5.5/assets/js/homepage.js
./storefront-4.5.5/assets/js/navigation.min.js
./storefront-4.5.5/assets/js/footer.js
./storefront-4.5.6/assets/js/woocommerce/header-cart.js
./storefront-4.5.6/assets/js/woocommerce/extensions/brands.js
./storefront-4.5.6/assets/js/sticky-add-to-cart.js
./storefront-4.5.6/assets/js/admin/plugin-install.js
./storefront-4.5.6/assets/js/admin/customizer.js
./storefront-4.5.6/assets/js/admin/admin.js
./storefront-4.5.6/assets/js/navigation.js
./storefront-4.5.6/assets/js/homepage.js
./storefront-4.5.6/assets/js/footer.js
gigitux commented 1 month ago

Thanks! I'm taking a look!

wiesys commented 1 month ago

Yes, I'm experiencing the same issue.

As a quick workaround, I added a few lines to the .htacess file so all missing .min.js files are read from corresponding .js versions.

<IfModule mod_rewrite.c>
RewriteEngine On

# Check if the request is for a .min.js file and it does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/wp-content/themes/storefront/assets/js/(.*)\.min\.js$

# Rewrite to the corresponding .js file
RewriteRule ^wp-content/themes/storefront/assets/js/(.*)\.min\.js$ /wp-content/themes/storefront/assets/js/$1.js [L]
</IfModule>

It also won't cause any problems when this issue will be fixed πŸ™‚

gigitux commented 1 month ago

storefront.zip

@wiesys Can you check if this build works correctly for you?

wiesys commented 1 month ago

Yes, @gigitux looks like it works – atleast no missing .min.js files in the logs πŸ™‚ Thank you! πŸ‘πŸ»

gigitux commented 1 month ago

Thanks for opening the issue! I deployed a new version that contains the min.js files! I'm going to close the issue!