I am trying to deploy Strapi (without the Docker file, with a regular Node.JS deployment) on AWS Elastic Beanstalk.
In my GitHub deployment action, we build Strapi (I am using the typescript version), and bundle and deploy.
At the end, the strapi repo incl. the .env file and the /dist folder is located on /var/app/current on the instances. However, every time we try to start the server, it fails with:
[2024-09-04 10:41:36.010] debug: ⛔️ Server wasn't able to start properly.
[2024-09-04 10:41:36.014] error: Cannot destructure property 'client' of 'db.config.connection' as it is undefined.
TypeError: Cannot destructure property 'client' of 'db.config.connection' as it is undefined.
at getDialect (/var/app/current/node_modules/@strapi/database/dist/index.js:1014:11)
at new Database (/var/app/current/node_modules/@strapi/database/dist/index.js:6195:20)
at Database.init (/var/app/current/node_modules/@strapi/database/dist/index.js:6181:16)
at Strapi.bootstrap (/var/app/current/node_modules/@strapi/strapi/dist/Strapi.js:372:39)
at Strapi.load (/var/app/current/node_modules/@strapi/strapi/dist/Strapi.js:426:16)
at async Strapi.start (/var/app/current/node_modules/@strapi/strapi/dist/Strapi.js:216:9)
The config file exists, both as .ts in the main folder, and in the dist folder. The .env file is definitely there. It works on localhost. I can’t even properly debug trace, since it seems like the stack trace only follows the strapi files in the node_modules folder.
This topic has been created from a Discord post (1280842217962864710) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord