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
{{ message }}
Repository navigation
Generating js migration files via CLI with --outputJs produces an unused import from typeorm #9149
Generating js migration files via CLI with --outputJs produces an unused import from typeorm.
I'm running the command: npm run typeorm -- migration:generate src/migrations/migration --dataSource src/datasource.ts --pretty --outputJs
Which produces a file src/migrations/12345-migration.js file as expected, and works with the migration:run command locally. However, the file contains unused require referring to the MigrationInterface and QueryRunner on the first line:
This causes 2 problems for me, although I'm sure there are other manifestations of this problem too.
It fails eslint no-unused-vars rule
I am running these migrations in an AWS lambda function. Typeorm is bundled with the migration lambda function code using esbuild. The migrations cannot be bundled unfortunately due to esbuild not being to resolve the imports from the migrations directory glob at build time. Therefore, the lambda fails when running migrations because the imported migration file does not have access to typeorm dependency (its bundled with the migration code).
Activity