Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while reading node_modules/.vite when replicating vue app in kubernetes #406

Closed
8 of 9 tasks
ZioPhil opened this issue May 18, 2024 · 1 comment
Closed
8 of 9 tasks

Comments

@ZioPhil
Copy link

ZioPhil commented May 18, 2024

Related plugins

Describe the bug

I have a vue app that works without problems when executed in kubernetes on a single pod without replication.
However, as soon as I try to replicate, it doesn't work anymore and it throws this kind of errors in the browser console when it tries to read content from node_modules/.vite (that I think is the vite cache):

Loading module from “https://srsproject.it/node_modules/.vite/deps/auth0.js?v=0a5335c3” was blocked because of a disallowed MIME type (“”).
Loading module from “https://srsproject.it/node_modules/.vite/deps/chunk-U6BEPC57.js?v=ddbe559a” was blocked because of a disallowed MIME type (“”).

Reproduction

https://github.com/ZioPhil/SrsProjectReproduction

Steps to reproduce

Install docker, kubectl and minikube
Download all files in the repo and cd into the folder
Run minikube delete
Run minikube start
Run helm install nginx-ingress ingress-nginx/ingress-nginx
In /etc/hosts pair srsproject.it with the ip returned by the command minikube ip
In another terminal, run minikube tunnel
Run kubectl apply -f .
Run kubectl delete ingress client-ingress
Run minikube dashboard
A dashboard window will open in your browser, go to "Deployments", open "client-deployment"
On the top right press "Scale resource" and scale it to 2
Open a browser tab, press CTRL+Shift +I, open srsproject.it in that window

System Info

System:
    OS: Linux 6.6 Alpine Linux
    CPU: (4) x64 Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz
    Memory: 1.86 GB / 3.71 GB
    Container: Yes
    Shell: 1.36.1 - /bin/ash
  Binaries:
    Node: 21.7.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^5.0.4 => 5.0.4 
    vite: ^5.2.11 => 5.2.11

Used Package Manager

npm

Logs

No response

Validations

@ZioPhil
Copy link
Author

ZioPhil commented May 27, 2024

The problem was that i was using the development version of the app on kubernetes. You must use the production version, that is generated with vite build or npm run build, if you have it configured in your package.json

@ZioPhil ZioPhil closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant