I have a Nuxt SSR app which want to deploy on server. My CI (Buddy) runs pipeline to do it by running bash commands. All of them runs without any error but at the end application can not find files in .nuxt directory. It throws an error 404 not found _nuxt/46f6559.modern.js Everything looks ok except the file really does not exists on the server. I try it by command
sudo find . -type f -name 46f6559.modern.js
to find it. It seems like main file link to old files which no longer exists in repository. But really dont know what is going on there. The build looks fresh and .nuxt folder is filled by build files.
This are the commands in pipeline which works fine.
yarn build
Then
if [ -d "builds/$BUDDY_EXECUTION_REVISION" ] && [ "$BUDDY_EXECUTION_REFRESH" = "true" ];
then
echo "Removing: builds/$BUDDY_EXECUTION_REVISION"
rm -rf builds/$BUDDY_EXECUTION_REVISION;
fi
if [ ! -d "builds/$BUDDY_EXECUTION_REVISION" ];
then
echo "Creating: builds/$BUDDY_EXECUTION_REVISION"
cp -dR deploy-cache builds/$BUDDY_EXECUTION_REVISION;
fi
Then
echo "Linking current to revision: $BUDDY_EXECUTION_REVISION"
rm -f current
ln -s builds/$BUDDY_EXECUTION_REVISION current
Then
pm2 startOrReload current/ecosystem.config.js --only Production
Everything ends up with success. Does anybody know what could happened there? My be the last of the commands? If I run it on local machine everything works well. Thanks for any help.