Strapi does not find db.config on AWS EB after deployment

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

Did you set the environment variables?
Perhaps you didnt set db client one so its failing to pick one from the config

I figured it out - super random, but i have to bundle the tsconfig.json into the deployed package

how cheap and easy is aws for deployment

AWS is the industry standard and original cloud provider

Its not difficult but you gotta know at least the basics

From your msg Im gonna go ahead and assume u have no knowledge of cloud so perhaps something like Digital Oceans App Platform will suit u better?

i can go through the steps

i want something i can total control over, something that can scale over years and is cost effective

content management can be difficult to manage when years pass by so i need to be sure

Hey, how did you include it? Simply by copying with Docker?