1

I am trying to serve 2 files needed by javascript for a web assembly package. The files example.wasm and example.data are in the public folder in the react js project file structure. When running with a development server using npm start, the files can be found by the project and can be read correctly. When building the project the files end up in the root directory of the project as expected. In spite of using the current PUBLIC_URL path for the files, the files can not be found, but the paths in the web console seem to be correct.

I am hosting the reactjs app from IIS 7.

Can you help me with the process to debug the problem described above?

Thank you in advance for your help.

  • https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis – Lex Li Dec 14 '20 at 18:17
  • @LexLi thank you very much for the answer, by enabling Failed Request Tracing I caught the following error in the IIS generated logs: SECURITY_DENIED_BY_MIMEMAP when my app was requesting the files. I added the mime types of .wasm and .data files in the IIS configuration. I guess they are not that common and they are not added to the default config. – Anastasios Bakirtzis Dec 14 '20 at 20:04
  • You can post your own answer and accept it. FRT is very useful and in the future you can use it for other scenarios. – Lex Li Dec 14 '20 at 21:10
  • Have you solved your problem? If it is solved, please share your answer, so that it can help more people who encounter this problem. – samwu Dec 15 '20 at 03:20

1 Answers1

0

After the help of @LexLi I have enabled the Failed Request Tracing Module in the IIS following this documentation:

[https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis][1]

Reading the log generated by the Failed Request Tracing Module I saw that when requesting the files example.wasm and example.data from the server the actual error was not 404 Not Found but:

SECURITY_DENIED_BY_MIMEMAP

After googling the error above I realized that the Default MIME Types configured in the IIS do not include files with extensions .data and .wasm. After adding those MIME Types to the IIS configuration using the MIME Type Module in the Web Server Level in IIS Management and restarting the server the problem was resolved.