cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.2.4 JQuery not loading

Magento 2.2.4 JQuery not loading

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:

  1. /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)
  2. 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.
  3. 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.

8 REPLIES 8

Re: Magento 2.2.4 JQuery not loading

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://magento.stackexchange.com/questions/212514/refused-to-apply-style-because-its-mime-type-text...

 

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 !

if issue solved,Click Kudos & Accept as Solution

Re: Magento 2.2.4 JQuery not loading

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
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Magento 2.2.4 JQuery not loading

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.

 

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento 2.2.4 JQuery not loading

@Rakesh Jesadiya @Manthan Dave @Sunil Patel

 

Thank you guys for your quick reply. I have checked and the .htaccess file is in place.

htaccess.jpeg

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

JQueryDir.jpeg

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.

Re: Magento 2.2.4 JQuery not loading

You need to reace your file name to jquery-storageapi.min because that file is available.

For Disable Static Sign You need to first change mode to Develoler do changes and revert back to production mode.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Magento 2.2.4 JQuery not loading

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 

if issue solved,Click Kudos & Accept as Solution

Re: Magento 2.2.4 JQuery not loading

@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.

 

 

Re: Magento 2.2.4 JQuery not loading

@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]