I just don’t know what to do anymore. Can anyone give me the solution?
opened 11:44PM - 27 Nov 23 UTC
closed 04:21AM - 28 Nov 23 UTC
flag: question
<!--
### Describe the bug
Hi, after a week of unactivity I tried to rebuild St… rapi admin panel after new content types were not added after reload and got error "TypeError: Cannot destructure property 'client' of 'db.config.connection' as it is undefined"
### Required System information
Full error log even after --debug is ->
│ TypeError: Cannot destructure property 'client' of 'db.config.connection' as it is undefined. │
│ at getDialect (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\database\dist\index.js:1014:11) │
│ at new Database (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\database\dist\index.js:6114:20) │
│ at Database.init (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\database\dist\index.js:6100:16) │
│ at Strapi.bootstrap (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\strapi\dist\Strapi.js:365:39) │
│ at Strapi.load (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\strapi\dist\Strapi.js:419:16) │
│ at async Object.develop (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\admin\dist\_chunks\index-cce8ecb6.js:1160:28) │
│ at async develop (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\admin\dist\_chunks\develop-69e28e61.js:52:5) │
│ at async Command.parseAsync (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\commander\lib\command.js:923:5) │
│ at async Module.runStrapiCommand (D:\nextjs_strapi\vita-multilang\portfolio-backend\node_modules\@strapi\strapi\dist\commands\index.js:124:3)
-->
## Bug report
- Node.js version: v18.18.2
- Yarn version: 1.22.19
- Strapi version:4.13.6/4.15.4 (doesn't matter -> both same error)
- Database: postgres
- Operating system: win32-x64
- Is your project Javascript or Typescript: ts
### Steps to reproduce the behavior
1. type **yarn build && yarn develop**
2. look at error
3. 8 times delete node_modules and change versions of Strapi
4. See error again
### Expected behavior
Development server -> localhost:1337
This topic has been created from a Discord post (1234323731300745286) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
<@242767266528100352> any updates on that issue? It’s really annoying…
1 Like
I solved it because the volumes were overwritten and the .env file could no longer be read. Now I only have the uploads as one volume, but I will also switch that to S3
You got me on the right tracks. Thanks a lot!
In my case there were two reasons.
I've edited cms/config/database.js according to what copilot said (not very good idea). Next time I'll just check the docs.
I wasn't copying .env file while preparing docker image.
So I guess missing env variables and incorrect database.js can cause this issue.