I have an error when deploying the nuxt part of my nuxt/laravel site to forge laravel. I get the following error Cannot find module ‘/home/forge/my-site.com/.output/server/chunks/app/_nuxt/index-DFotAjTC.mjs’ imported from /home/forge/my-site.com/.output/server/chunks/app/server.mjs.
Looking into the files, there is not index-DFotAjTC.mjs.
I’m guessing it’s a cache error but even after removing all cache i still have to error.
Could anyone point me to a direction to resolve this error?
My deployment script:
cd /home/forge/myra-calendars.com
git pull origin $FORGE_SITE_BRANCH
export NODE_OPTIONS="--max_old_space_size=4096"
rm -rf .output
npm install
npm run build
#pm2 start npm --name "my-site.com" --watch -- start
pm2 restart ./ecosystem.config.cjs
My nginx script:
include forge-conf/my-site.com/before/*;
server_name my-site.com;
server_tokens off;
root /home/forge/my-site.com;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/my-site.com/2256353/server.crt;
ssl_certificate_key /etc/nginx/ssl/my-site.com/2256353/server.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AEA128-GCM-SHQ256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCE-SHA384:ECDHE-ECDSA-CAACHA20-POLY1305:ECDHE-RSA-CHACHA20-PALYF305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_dhparam /etc/nginx/dhparams.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/my-site.com/server/*;
# Proxy requests to the Nuxt frontend
location / {
proxy_redirect off;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
}
access_log off;
error_log /var/log/nginx/my-site.com-error.log error;
location ~ /.(?!well-known).* {
deny all;
}
}
include forge-conf/my-site.com/after/*;