Failed to compile on build
Unanswered
Cornish Rex posted this in #help-forum
Cornish RexOP
Hey guys! im trying to auto deploy my nextjs app it all works fine if i run the ./deploy.sh it pulls, npm ci, npm run build and it works
but when github triggers it it will: pull, npm ci, npm run build but this time the build errors:
but as i said this error wont appear if i run the script manually
deploy.sh
any help is appreciate it 🙂
but when github triggers it it will: pull, npm ci, npm run build but this time the build errors:
> nextwar@0.4.4 build
> next build
▲ Next.js 14.2.5
- Environments: .env
Creating an optimized production build ...
Failed to compile.
./src/app/(dashboard)/beta/BetaKeysActions.tsx
Module not found: Can't resolve '@/components/ui/dropdown-menu'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/app/(dashboard)/beta/BetaUserTableRender.tsx
./src/app/(dashboard)/beta/BetaKeysActions.tsx
Module not found: Can't resolve '@/components/ui/button'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/app/(dashboard)/beta/BetaUserTableRender.tsx
./src/app/(dashboard)/beta/BetaUserTableRender.tsx
Module not found: Can't resolve '@/components/ui/button'
https://nextjs.org/docs/messages/module-not-found
./src/app/(dashboard)/beta/BetaUserTableRender.tsx
Module not found: Can't resolve '@/components/ui/table'
https://nextjs.org/docs/messages/module-not-found
./src/app/(dashboard)/beta/BetaUserTableRender.tsx
Module not found: Can't resolve '@/utils/convertDate'
https://nextjs.org/docs/messages/module-not-found
> Build failed because of webpack errors
Use --update-env to update environment variables
but as i said this error wont appear if i run the script manually
deploy.sh
#!/bin/sh
git pull origin production 2>&1 | tee -a redeploy.log
npm ci 2>&1 | tee -a redeploy.log
npm run build 2>&1 | tee -a redeploy.log
pm2 restart Panel 2>&1 | tee -a redeploy.log
any help is appreciate it 🙂