pancakeswap / pancake-swap-core

Core smart contracts
GNU General Public License v3.0
278 stars 692 forks source link

Error: Callback was already called. #15

Open qiluge opened 3 years ago

qiluge commented 3 years ago

When I run yarn test, the error occured:

yarn run v1.22.10
$ yarn compile
$ yarn clean
$ rimraf ./build/
$ waffle .waffle.json
$ mocha

  PancakeERC20
    1) "before each" hook

  PancakeFactory
    2) "before each" hook

  PancakePair
    3) "before each" hook

  0 passing (360ms)
  3 failing

  1) PancakeERC20
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)
      at runNextTicks (internal/process/task_queues.js:62:3)
      at processImmediate (internal/timers.js:434:9)

  2) PancakeFactory
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  3) PancakePair
       "before each" hook:
     Uncaught Error: Callback was already called.
      at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
      at WriteStream.<anonymous> (node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
      at WriteStream.destroy (node_modules/level-ws/level-ws.js:140:8)
      at finish (internal/streams/writable.js:670:14)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)
      at runNextTicks (internal/process/task_queues.js:62:3)
      at processImmediate (internal/timers.js:434:9)

/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358
                callback(err);
                ^
Error: Callback was already called.
    at /mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
    at WriteStream.<anonymous> (/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
    at WriteStream.emit (events.js:315:20)
    at WriteStream.destroy (/mnt/e/workspace/solidity/pancakeswap/pancake-swap-core/node_modules/level-ws/level-ws.js:140:8)
    at finish (internal/streams/writable.js:670:14)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
error Command failed with exit code 3.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My nodeJS version is: v14.16.0

Sumair-Aslam commented 3 years ago

I am also facing same issue

RaRedmer commented 3 years ago

Same here

RaRedmer commented 3 years ago

So changing nodeJS to version 10.x or 12.x fixes this issue. Seems plausible, since the the CI GitHub-Action pipeline test only for these two versions (see https://github.com/pancakeswap/pancake-swap-core/blob/master/.github/workflows/CI.yml).

hypermunkee commented 3 years ago

Same issue. I'm running Node v16.2.0. I guess downgrading to 12.x is an option, but this codebase (the tests, not the contracts obviously) should really be updated since this is an active project.