Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CLI commands skip config validation #2145

Closed
oliversalzburg opened this issue Aug 25, 2021 · 0 comments · Fixed by #2146
Closed

Some CLI commands skip config validation #2145

oliversalzburg opened this issue Aug 25, 2021 · 0 comments · Fixed by #2146
Assignees

Comments

@oliversalzburg
Copy link
Contributor

Describe the bug
Calling certain CLI commands can produce unexpected errors, because they skip config validation.

Stack trace

TypeError: Cannot destructure property 'className' of 'Configuration.PLATFORMS[this.options.type]' as it is undefined.
    at Configuration.initDriver (/home/oliver/projects/mikro-orm/packages/core/dist/utils/Configuration.js:160:21)
    at new Configuration (/home/oliver/projects/mikro-orm/packages/core/dist/utils/Configuration.js:26:28)
    at Function.getConfiguration (/home/oliver/projects/mikro-orm/packages/core/dist/utils/ConfigurationLoader.js:26:24)
    at async Object.handler (/home/oliver/projects/mikro-orm/packages/cli/dist/commands/GenerateCacheCommand.js:19:24)

To Reproduce
Steps to reproduce the behavior:

  1. Create a mikro-orm.config.js with only module.exports = {};
  2. Run mikro-orm cache:generate

Expected behavior
No unhandled errors.

Versions

Dependency Version
node 16.6.2
typescript 4.3.5
mikro-orm 4.5.9
your-driver postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants