microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend shows blankpage

apvarana opened this issue · comments

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

Hi @apvarana , thanks for raising the issue.

Can you share a few more details, such as:

  • Context for how you are running the code (locally or in deployment)
  • Full stack trace for the error you reported above

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.

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

I don't, but I'll investigate.