RobinCK / typeorm-fixtures

:pill: Fixtures loader for typeorm πŸ‡ΊπŸ‡¦
https://robinck.github.io/typeorm-fixtures/
MIT License
566 stars 45 forks source link

[Bug] #141

Closed mtbvang closed 4 years ago

mtbvang commented 4 years ago

Your Environment

We have the following setup and when we run the fixtures we get pages of UnhandledPromiseRejectionWarning output. It seems to be related to bcryptjs. We have a target in a make file which calls a package.json script specifying which fixtures orm config file to use:

make file command that calls the package.json scirpt npm run fixtures -- --config tests/ormconfig_docker-local.yml

package.json script "fixtures": "rm -f .env && fixtures ./tests/fixtures --require=ts-node/register",

ormconfig_docker-local.yml

- name: default
  type: postgres
  host: database
  port: 5432
  database: xxx
  username: xxx
  password: xxx
  synchronize: false
  logging: false
  entities:
    - ./server/entities/**/*.ts
  cli:
    entitiesDir: ./server/entities
Software Version(s)
typeorm-fixtures "typeorm-fixtures-cli": "^1.4.2"
bcryptijs "bcryptjs": "^2.4.3"
Node 12.14.1
npm/Yarn 6.13.4
Operating System ubuntu 18.04
(node:33) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4899)
(node:33) UnhandledPromiseRejectionWarning: Error: Illegal arguments: function, undefined
    at _async (/app/node_modules/bcryptjs/dist/bcrypt.js:214:46)
    at /app/node_modules/bcryptjs/dist/bcrypt.js:223:17
    at new Promise (<anonymous>)
    at User.bcrypt.hash (/app/node_modules/bcryptjs/dist/bcrypt.js:222:20)
    at Promise (internal/util.js:275:30)
    at new Promise (<anonymous>)
    at User._hashAsync (internal/util.js:274:12)
    at _loop_1 (/app/src/TransformOperationExecutor.ts:154:47)
    at TransformOperationExecutor.transform (/app/node_modules/class-transformer/TransformOperationExecutor.js:260:17)
    at _loop_1 (/app/src/TransformOperationExecutor.ts:246:43)
    at TransformOperationExecutor.transform (/app/node_modules/class-transformer/TransformOperationExecutor.js:260:17)
    at ClassTransformer.plainToClassFromExist (/app/src/ClassTransformer.ts:55:25)
    at Object.plainToClassFromExist (/app/src/index.ts:48:29)
    at Builder.<anonymous> (/app/node_modules/typeorm-fixtures-cli/src/Builder.ts:78:22)
    at Generator.next (<anonymous>)
    at /app/node_modules/typeorm-fixtures-cli/dist/Builder.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/app/node_modules/typeorm-fixtures-cli/dist/Builder.js:3:12)
    at Builder.build (/app/node_modules/typeorm-fixtures-cli/dist/Builder.js:26:16)
    at Function.loadFixtures (/app/tests/support/utils.ts:232:51)
    at process._tickCallback (internal/process/next_tick.js:68:7)ŽÁ
RobinCK commented 4 years ago

It’s hard to understand what the problem is. Can you make a minimal sample with your problem?

mtbvang commented 4 years ago

@RobinCK sorry for the delayed response. I noticed that the newest 1.5.0 version of the fixtures cli on one tenth of error output is being logged. I'll work on getting a minimal sample to you in the next couple of days.


(node:1100) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by)
Progress  [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘] 94% | ETA: 5s | 128/136 investLiquidityLog5d
    at _async (/app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:214:46)
    at /app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:223:17
    at new Promise (<anonymous>)
    at User.bcrypt.hash (/app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:222:20)
    at internal/util.js:278:30
    at new Promise (<anonymous>)
    at User._hashAsync (internal/util.js:277:12)
    at _loop_1 (/app/cs-backend/src/TransformOperationExecutor.ts:154:47)
    at TransformOperationExecutor.transform (/app/cs-backend/node_modules/class-transformer/TransformOpera)
    at _loop_1 (/app/cs-backend/src/TransformOperationExecutor.ts:246:43)
(node:1100) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by)
(node:1100) UnhandledPromiseRejectionWarning: Error: Illegal arguments: function, undefined
    at _async (/app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:214:46)
    at /app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:223:17
    at new Promise (<anonymous>)
    at User.bcrypt.hash (/app/cs-backend/node_modules/bcryptjs/dist/bcrypt.js:222:20)
    at internal/util.js:278:30
    at new Promise (<anonymous>)
    at User._hashAsync (internal/util.js:277:12)
    at _loop_1 (/app/cs-backend/src/TransformOperationExecutor.ts:154:47)
    at TransformOperationExecutor.transform (/app/cs-backend/node_modules/class-transformer/TransformOpera)
    at _loop_1 (/app/cs-backend/src/TransformOperationExecutor.ts:246:43)