microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.43k stars 2.14k forks source link

Frontend shows blankpage #878

Open apvarana opened 1 month ago

apvarana commented 1 month ago

While running the code I receive following error and shows up blank page

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

Any fix for this issue. Pls help

abhahn commented 1 month ago

Hi @apvarana , thanks for raising the issue.

Can you share a few more details, such as:

apvarana commented 1 month ago

Added this in the top of app.py import mimetypes mimetypes.add_type('application/javascript', '.js') mimetypes.add_type('text/css', '.css')

used localhost instead of 127.0.0.1 - Refer to bug #70 . same issue

There is no trace except the below Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

abhahn commented 1 month ago

Assigning to @iseabock -- do you happen to know why this might be needed in some situations in the backend?

iseabock commented 4 weeks ago

I don't, but I'll investigate.