Hey folks,
I've tried adding my own sliders and I keep getting errors so I decided to download one off the Magento extensions store. Unfortunately, I am facing the same issue again.
The JS is not working for any of the slider I make and I get the following error from the Chrome browser console:
/pub/static/version1528490897/frontend/Magento/luma/en_US/jquery/jquery-storageapi.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to execute script from 'http://website.com/pub/static/version1528490897/frontend/Magento/luma/en_US/jquery/jquery-storageapi.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught Error: Script error for: jquery/jquery-storageapi http://requirejs.org/docs/errors.html#scripterror at makeError (require.js:166) at HTMLScriptElement.onScriptError (require.js:1681)
Have any of y'all faced an issue like this? It looks like the luma theme may not have JQuery installed correctly. Would you please give me some troubleshooting steps?
Thank you.
Hi @j_w2
There are multiple reasons that your jQuery js not loading.
Main reason you need to check is - .htaccess file is there or not in pub/static directory ? it is required in pub/static directory.
You need refer below links :
https://github.com/magento/magento2/issues/11170
Also try to run below query in your core_config_data table :
insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);
Hope it helps !
You need to disable static file sign from admin panel.
This works only on your production mode or default mode.
Go To Admin panel,
Stores -> Configuration ->Advanced -> Developer tab
Go to Static Files Settings Tabs,
Set Sign Static Files to No.
Save Configuration.
Developer Tab only available when your site mode is Developer or Default Mode.
Otherwise, you need to run Query suggested by @Manthan Dave for remove version from your static files like js.
If you haven't Database access and if you want to change sign static files to No you first need to run command for made developer mode to your site.
For Make developer mode run below command,
php bin/magento deploy:mode:set developer
Hello @j_w2
no need to disable static sign, it is very good feature provide my Magento to load js and css changes.
Make sure you did following thing
1) pun/static folder must contain .htaccess file
2) after adding new js and do static deploy.
Hope it will help you.
@Rakesh Jesadiya @Manthan Dave @Sunil Patel
Thank you guys for your quick reply. I have checked and the .htaccess file is in place.
However, when I checked the
pub/static/frontend/Magento/luma/en_US/jquery
I noticed that there was no file named jquery-storageapi.js, only one closed to its name was jquery-storageapi.min.js
Do you guys think that this might be the problem? Am I able to just obtain a copy of jquery-storageapi.js and add it into the directory or if I can just make a copy ofjquery-storageapi.min.js and rename it jquery-storageapi.js?
Also, I am currently in production mode so I do not have access to the developer tab. Should I switch back to developer or default and try to disable static sign?
Thank you guys so much for your continued support.
Hi @j_w2
Yes - there might be a reason !
So just rename your file with some another !
Also run the query which i have posted above into core_config_data table or else - enabled developer mode !
Then disabled static sign from backend and then try !
It will works
@Manthan Dave @Rakesh Jesadiya
Thanks for the quick reply guys. I just went ahead and turned off static sign and I am having the same issue. It looks the the problem is also happening on my product page with the product image being stuck on loading. With the following errors (some are identical to previous experienced errors)
GET http://website.com/pub/static/frontend/Magento/luma/en_US/jquery/jquery-storageapi.js 404 (Not Found)
Refused to execute script from 'http://website.com/pub/static/frontend/Magento/luma/en_US/jquery/jquery-storageapi.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught Error: Script error for: jquery/jquery-storageapi http://requirejs.org/docs/errors.html#scripterror
http://website.com/pub/static/frontend/Magento/luma/en_US/priceBox.js 404 (Not Found)
Refused to execute script from 'http://website.com/pub/static/frontend/Magento/luma/en_US/priceBox.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught Error: Script error for: priceBox http://requirejs.org/docs/errors.html#scripterror at makeError (require.js:166) at HTMLScriptElement.onScriptError (require.js:1681)
Not sure why this is occurring. Thank you for your continued support.
@Manthan Dave @Rakesh Jesadiya
Hey guys - I might have found out what is going wrong. Does my server need to have mod_rewrite turned on for Magento 2? I checked my phpinfo and it may have been off.
Thanks.
EDIT: [Nevermind, I just talked with my hosting service and they told me it was turned on]