diff --git a/mikro-orm.config.ts b/mikro-orm.config.ts index 43b4a0fa..57eb8715 100644 --- a/mikro-orm.config.ts +++ b/mikro-orm.config.ts @@ -1,9 +1,11 @@ // @ts-nocheck +import 'reflect-metadata' + +import process from 'node:process' import { Options } from '@mikro-orm/core' import * as entities from '@/entities' -import { env } from '@/env' import { PluginsManager } from '@/services' import { resolveDependency } from '@/utils/functions' @@ -14,7 +16,7 @@ export default async () => { await pluginsManager.loadPlugins() return { - ...mikroORMConfig[env.NODE_ENV || 'development'] as Options, + ...mikroORMConfig[process.env.NODE_ENV || 'development'] as Options, entities: [...Object.values(entities), ...pluginsManager.getEntities()], } } diff --git a/src/utils/types/environment.ts b/src/utils/types/environment.ts index 11eb0f84..3297cff5 100644 --- a/src/utils/types/environment.ts +++ b/src/utils/types/environment.ts @@ -5,7 +5,7 @@ import { cleanEnv, num, str } from 'envalid' import { apiConfig, generalConfig, mikroORMConfig } from '@/configs' export const env = cleanEnv(process.env, { - NODE_ENV: str({ choices: ['development', 'production'] }), + NODE_ENV: str({ choices: ['development', 'production'], default: 'development' }), BOT_TOKEN: str(), TEST_GUILD_ID: str(),