Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Truffle '"Migrations" -- cb is not a function'

I wrote a simple smart contract in Solidity 0.6.6 that I'm trying to deploy to the BSC Testnet.

This is what I have in my truffle-config.js file (privateKeys is an array with a single entry of ['0x + privatekey']:

networks: {
   bscTestnet: {
      provider: () => new HDWalletProvider(
        privateKeys,
        'https://data-seed-prebsc-1-s1.binance.org:8545/'
      ),
      network_id: 97,
      skipDryRun: true
   }
}

When I run the command "truffle migrate --reset --network bscTestnet" I get the following error:

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'bscTestnet'
> Network id:      97
> Block gas limit: 30000000 (0x1c9c380)


1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- cb is not a function.

    at /Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Migration._deploy (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:70:1)
    at Migration._load (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:56:1)
    at Migration.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1)
    at Object.runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
    at Object.runFrom (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
    at Object.runAll (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
    at Object.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
    at runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:80:1)
    at Object.module.exports [as run] (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:44:1)
    at Command.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:189:1)
Truffle v5.4.31 (core: 5.4.31)
Node v17.4.0
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Opened an Issue a about it: https://github.com/trufflesuite/truffle/issues/4676 I guess its a bug in HardwareWallet2.0.2. Reverting to HardwareWallet2.0.0 solved the problem for me

npm i @truffle/hdwallet-provider@2.0.0

about 4 years ago · Juan Pablo Isaza Report

0

UPDATE: Right, workaround: I rolled @HDWalletProvider back to v2.0.1 and was able to migrate.

I assume there must be an issue with the new version for ppl who updated today.

================

Same problem with Polygon Mumbai.

Function "cb" refers to the callback function. The strange part is the error message doesn't reference my own code at all; it references the migrations.js located in:

<.nvm/versions/node/v16.11.1/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1 at processTicksAndRejections (node:internal/process/task_queues:96:5>

This leads me to believe there's a problem with out 1_initial_migration.js... however that's auto-generated so I can't see any problem... it's strange.

1_initial_migration.js:

const Migrations = artifacts.require("Migrations");

module.exports = function(deployer) {
  deployer.deploy(Migrations);
};
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!