You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error during migration generation:
TypeError: dataSourceFileExports is not iterable
at Function.loadDataSource (/Some/Path/backend/node_modules/src/commands/CommandUtils.ts:37:34)
at async Object.handler ((/Some/Path/backend/node_modules/src/commands/MigrationGenerateCommand.ts:73:26)
I have tried numerous approaches to the export but they basically all fail.
Steps to reproduce
Define an async DataSource and run the migrate:generate or migrate:run command.
My Environment
Dependency
Version
Operating System
Node.js version
v18.15.0
Typescript version
4.5.5
TypeORM version
0.3.17
Additional Context
After some debugging it turns out that the problem lies in the CommandUtils.ts - checking for someting instanceof Promise is not stable and it does not work on my machine ™️. The check fails and thus passes the promise up the chain to the InstanceChecker which naturally fails.
I have a PR coming.
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
The text was updated successfully, but these errors were encountered:
Issue description
When defining an async datasource to use for migrations the typeorm CLI breaks
Expected Behavior
It should be possible to define async
DataSource
according to:#8914
And use that for configuring TypeOrm.
Actual Behavior
When declaring an async data source as mentioned in the original issue #8914
It fails with
Error during migration generation: TypeError: dataSourceFileExports is not iterable at Function.loadDataSource (/Some/Path/backend/node_modules/src/commands/CommandUtils.ts:37:34) at async Object.handler ((/Some/Path/backend/node_modules/src/commands/MigrationGenerateCommand.ts:73:26)
I have tried numerous approaches to the export but they basically all fail.
Steps to reproduce
Define an async
DataSource
and run themigrate:generate
ormigrate:run
command.My Environment
Additional Context
After some debugging it turns out that the problem lies in the
CommandUtils.ts
- checking forsometing instanceof Promise
is not stable and it does not work on my machine ™️. The check fails and thus passes the promise up the chain to theInstanceChecker
which naturally fails.I have a PR coming.
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
The text was updated successfully, but these errors were encountered: