Skip to content

[Bug] Mikro-ORM return "Cannot read properties of undefined" #176

Description

@Mr-Artemus

What happened?

When using MySQL, Mikro-ORM can't create migration due the following error :

TypeError: Cannot read properties of undefined (reading 'BOT_OWNER_ID')
    at Object.<anonymous> (C:\Users\Josh\Documents\Projects\RoseBot\src\configs\general.ts:8:15)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module.m._compile (C:\Users\Josh\Documents\Projects\RoseBot\node_modules\ts-node\src\index.ts:1618:23)
    at node:internal/modules/cjs/loader:1698:10
    at Object.require.extensions.<computed> [as .ts] (C:\Users\Josh\Documents\Projects\RoseBot\node_modules\ts-node\src\index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1303:32)
    at Function._load (node:internal/modules/cjs/loader:1117:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1325:12)

Credit : @JoshCantCode
Cf : Discord support thread

Reproduction

  1. Init a new bot
  2. Setup .env file
  3. Change database config to use a MySQL database
  4. Run any Mikro-ORM command

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

URGENTbugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions