question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found 'child_process'

See original GitHub issue

I am getting this error while I try to run it with Next.js My question is Can we use truffle-hdwallet-provider in front end apps? Or Is it strictly to use in the backend? I understand the mnemonics, private keys that I get to share in browser but whatsoever for testing purposes I wanted to use. this is giving me the following error

./node_modules/truffle-hdwallet-provider/dist/index.js
Module not found: Can't resolve 'child_process' in '/home/user/Work/projectName/node_modules/truffle-hdwallet-provider/dist'

My package.json

{
  "name": "kickstarter",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "mocha",
    "dev": "next dev"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "fs-extra": "^7.0.1",
    "ganache-cli": "^6.4.3",
    "mocha": "^6.1.4",
    "next": "^8.1.0",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "solc": "^0.5.7",
    "truffle-hdwallet-provider": "^1.0.7",
    "web3": "^1.0.0-beta.37"
  }
}

My web3.js file

import Web3 from 'web3';
import * as HDWalletProvider from 'truffle-hdwallet-provider';


const provider = new HDWalletProvider(
    '12 weods mnemonics',
    'infura/api/url'
);

const web3 = new Web3(provider);

export default web3;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
rogargoncommented, May 2, 2019

Experienced a similar error with module child_process and also net with and Angular application. Solved it by adding to package.json:

    ...
  },
  "browser": {
     "child_process": false, "net": false
  }
}
1reaction
eggplantzzzcommented, Apr 29, 2019

Ok thanks, I’ll try to investigate and see if I come up with anything!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error can't resolve 'child_process', how to fix?
But as soon as I try to use child process, using 'require("child_process")' I get the following error when trying to build the extension....
Read more >
Module not found: Can't resolve 'child_process' error [Solved]
The error "Module not found: Error: Can't resolve 'child_process'" occurs because there has been a breaking change in Webpack version 5. To solve...
Read more >
Module not found: Can't resolve 'child_process' #192 - GitHub
error whenever I try to use node-notifier. I'm using Node v6.11.2 and the code is copy-paste from the examples. Any ideas?
Read more >
Module not found: Error can't resolve in react - YouTube
The following issues are handled:1. Module not found : Error can't resolve ' child_process '2. Uncaught ReferenceError: the process is not ...
Read more >
cannot find module 'child_process' or its corresponding type ...
I am having an issue with my child process, which is not recognizing the 'tsconfig' file ... These errors both occur because of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found