useElementSize is not defined, when deploy on kubernetes

Hello 👋

I try to deploy a nuxt ui pro template to a kubernetes cluster. Everything fine, the app is successfully deployed + alive.
But when i create a simple port-forward on it and I load the app i got
useElementSize is not defined
.

But unfortunately, when I run the same image locally i don't get the error. Have you ever heard of this issue ?

My dockerfile :

# use node 16 alpine image as build image
FROM node:20-alpine as builder

# create work directory in app folder
WORKDIR /app

# install required packages for node image
RUN apk --no-cache add openssh g++ make python3 git

# install pnpm
RUN npm install -g pnpm

# copy over package.json files
COPY package.json /app/
COPY pnpm-lock.yaml /app/

# set the build-time argument
ARG NUXT_UI_PRO_LICENSE

# set the environment variable
ENV NUXT_UI_PRO_LICENSE=$NUXT_UI_PRO_LICENSE

# install all dependencies
RUN pnpm install

# copy over all files to the work directory
ADD . /app

# build the project
RUN pnpm run build

# start final image
FROM node:20-alpine

WORKDIR /app

# copy over build files from builder step
COPY --from=builder /app/.output  /app/.output
COPY --from=builder /app/.nuxt  /app/.nuxt

# expose the host and port 3000 to the server
ENV HOST 0.0.0.0
EXPOSE 3000

# run the build project with node
ENTRYPOINT ["node", ".output/server/index.mjs"]


My deployment file (k8s) :

apiVersion: apps/v1
kind: Deployment
metadata:
  name: prophunter-frontend-deployment
  labels:
    app: prophunter-frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prophunter-frontend
  template:
    metadata:
      labels:
        app: prophunter-frontend
    spec:
      containers:
      - name: prophunter-frontend
        image: prophunter-frontend:latest
        ports:
        - containerPort: 3000


My service file :

apiVersion: v1
kind: Service
metadata:
  name: prophunter-frontend-service
spec:
  selector:
    app: prophunter-frontend
  ports:
    - name: http
      port: 3000
      targetPort: 3000
  type: LoadBalancer


Thanks for your help 🙏

If you need any further information, please do not hesitate to ask me 🙂
CleanShot_2024-04-05_at_22.50.142x.png
Was this page helpful?