I actually try to pass env variable to the front but the problem is the build fails each time and i tried to relaunch it by SSH, there is the error I get when trying to build (Error that I don’t have on my local environment either in NODE_ENV development/production) : yarn run v1.22.5 $ strapi build Building your admin UI with production configuration ... ● Webpack █████████████████████████ building (48%) 323/373 modules 50 active babel-loader › .cache/plugins/strapi-plugin-users-permissions/admin/src/translations/index.js Error: Module not found: Error: Can't resolve './assets/images/logo.svg' in '/usr/app/.cache/plugins/strapi-plugin-users-permissions/admin/src'
This is typically due to some outdated cached packages
Please delete the following files and folders:
.cache
build
node_modules
package-lock.json
yarn.lock
Then reinstall your node_modules with npm i or yarn install and rebuild the admin with NODE_ENV=production yarn build or NODE_ENV=production npm run build
Thank you for your answer @DMehaffy.
After more search into what makes it doesn’t work is that it seems that the CI process is not well implemented. The .env file generation is called after the admin build which cause the front not to get the proper environment variable values.
I’ll update that and let you know if I still get errors during deployment
Yup, I tried what he said. I also made sure from the start that I had the .env file in place.
Going to try removing MySQL, and using MariaDB. I used MariaDB locally… Not sure if maybe using MySQL instead of MariaDB on the prod server is causing this.
I had the same problem as @muzu above, where it was hanging , or getting really slow to build. It was not dying or throwing any errors though. It did turn out the issue was servers size. I was using t2.micro on AWS and that was too small.
Once I moved to a t2.medium build happens reasonably quickly.