1

I install Magento 2 on IIS 7, it is working good, but on home page and all other pages including admin panel a JavaScript error occurred

the error is :

NetworkError: 404 Not Found - http://localhost:8080/pub/static/frontend/Magento/luma/en_US/js-translation.json"
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
$.mage.translate.add(JSON.parse(string));

then I explore location /pub/static/frontend/Magento/luma/en_US/ and found that the file is there when open the file it is contain just two square bracket [].

then i delete my old magento store and setup with new magento store with second level domain. but still problem is not fixed, but another issue arise my admin penal stopped work.! now the error look like

NetworkError: 404 Not Found - http://www.m2.com/pub/static/frontend/Magento/luma/en_US/js-translation.json" SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data $.mage.translate.add(JSON.parse(string));

i dont know why magento show that file is not found, because it is already there

I already delete folders in pub/static directory and then re-run the deploy command from cmd

php bin/magento setup:static-content:deploy

but it is not work for me. is magento support IIS 7 ? is problem occurred due to iis ?

1
  • if you want to get an answer on your question, please, correct it in a clear way Feb 25, 2016 at 15:28

1 Answer 1

1

this is an IIS issue to fix it please follow this steps:

  1. Open IIS Manager
  2. Display properties for the IIS Server
  3. Click MIME Types and then add the JSON extension:

    File name extension: .json
    MIME type: application/json 
    
  4. Go back to the properties for IIS Server
  5. Click on Handler Mappings
  6. Add a script map

    Request path: *.json
    Executable: C:\WINDOWS\system32\inetsrv\asp.dll
    Name: JSON 
    

And then browse your json file in broswer, if your IIS setup successfully now you can see the json file content in broswer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.