<p>I've built a React application utilizing ViteJS with TypeScript. I've built the project using <code>tsc &amp;&amp; vite build</code>. I've then built the Docker image based on my Dockerfile:</p>
<pre><code>FROM node:18.12.0
COPY build /build
RUN npm i -g serve
CMD [&quot;serve&quot;, &quot;-s&quot;, &quot;build&quot;, &quot;-p&quot;, &quot;5173&quot;]
HEALTHCHECK CMD wget --no-verbose --tries=1 --spider http://localhost:5173/ || exit 1
</code></pre>
<p>I've tested the Docker Image locally, and it builds as intended and when run the container boots up and the application is accessible and wors as it should.</p>
<p>I've been following Microsofts documentation for utilizing an Nginx Ingress Controller: <a href="https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli" rel="nofollow noreferrer">Create an ingress controller in Azure Kubernetes Service (AKS)</a></p>
<p>So, my manifest for this service looks like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: aks-helloworld-one  
spec:
  replicas: 1
  selector:
    matchLabels:
      app: aks-helloworld-one
  template:
    metadata:
      labels:
        app: aks-helloworld-one
    spec:
      containers:
      - name: aks-helloworld-one
        image: ghcr.io/akusasdesign/localizer:test-serve
        ports:
        - containerPort: 5173
        env:
        - name: TITLE
          value: &quot;Welcome to Azure Kubernetes Service (AKS)&quot;
      imagePullSecrets:
        - name: github-container-registry
---
apiVersion: v1
kind: Service
metadata:
  name: aks-helloworld-one  
spec:
  type: ClusterIP
  ports:
  - port: 5173
  selector:
    app: aks-helloworld-one
</code></pre>
<p>The service and Deployment are both created, but when moving to the url, the page is white/blank. Checking the console I can see the error message:</p>
<pre><code>Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of &quot;text/html&quot;. Strict MIME type checking is enforced for module scripts per HTML spec.
</code></pre>
<p>I've done some searching, but can't find a reason/fix for this problem.</p>

Akusas
<p>The MIME type for <code>.mjs</code> files needs to be <code>text/javascript</code>.<br />
For more innformation check out the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js" rel="nofollow noreferrer">MDN documentation</a> about that topic.</p>
