From ec63a616523221ec2216782845e508a59c6d0a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 15 May 2025 17:29:57 +0200 Subject: [PATCH] fix(core): Load config early to fix `N8N_CONFIG_FILES` (#15406) --- packages/cli/bin/n8n | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli/bin/n8n b/packages/cli/bin/n8n index 7fd641b1bb6..c234c5ff7b0 100755 --- a/packages/cli/bin/n8n +++ b/packages/cli/bin/n8n @@ -48,6 +48,11 @@ if (process.env.E2E_TESTS !== 'true') { require('dotenv').config(); } +// Load config early to ensure `N8N_CONFIG_FILES` values are populated into `GlobalConfig` +// _before_ typeorm entities in `@n8n/db` are loaded, as typeorm entity decorators rely on +// `GlobalConfig.database.type` to decide on column types and timestamp syntax. +require('../dist/config'); + if (process.env.NODEJS_PREFER_IPV4 === 'true') { require('dns').setDefaultResultOrder('ipv4first'); }