0

When trying to migrate a truffle-config.js file following error appears.

TypeError: Cannot read property 'fromMasterSeed' of undefined

any help would be much appreciated.

const HDWalletProvider = require('@truffle/hdwallet-provider');
 const mnemonic = '...(mnemonic from ganache-cli)';

module.exports = {
  

  networks: {
    
    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
     },
   
     ropsten: {
     provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/24d0d20d8912488eaeb85f0e671caf3d`),
     network_id: 3,       // Ropsten's id

    
  },

  compilers: {
    solc: {
       version: "^0.4.1",    
   
    }
  }
};

node v15.4.0

npm v7.0.15

web3@1.2.1

Truffle v5.1.58

Ganache CLI v6.12.1

2
  • 1
    Post the truffle config file, and the versions
    – Majd TL
    Jan 5 at 20:27
  • The truffle-config.js has an unbalanced {. Also "compilers" section is inside "networks" and it should be at the same level. Use some tool to indent the file so the problem will be more visible.
    – Ismael
    Jan 6 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.