trufflesuite / truffle-require

Executed a Javascript module within a Truffle context
7 stars 9 forks source link

Require from local modules still does not work fully #3

Closed roderik closed 7 years ago

roderik commented 7 years ago

Using the bundled version of Truffle

{ Error: Cannot find module "."
    at webpackMissingModule (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:85175:64)
    at require (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:85175:142)
    at performMigration (/Users/roderik/Development/mint/products/ethermint/migrations/3_initial_data.js:8:17)
    at /Users/roderik/Development/mint/products/ethermint/migrations/3_initial_data.js:71:12
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:84668:12
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:204781:15
    at <anonymous> code: 'MODULE_NOT_FOUND' }

Migration line 8 has:

    var hdkey = require('ethereumjs-wallet/hdkey')

ethereumjs-wallet is installed locally. And since that did not work, also globally

Installed the non bundled version and deinstalled globally

{ Error: Cannot find module 'ethereumjs-wallet/hdkey'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at require (/usr/local/lib/node_modules/truffle/node_modules/truffle-require/index.js:71:20)
    at performMigration (/Users/roderik/Development/mint/products/ethermint/migrations/3_initial_data.js:8:17)
    at /Users/roderik/Development/mint/products/ethermint/migrations/3_initial_data.js:71:12
    at /usr/local/lib/node_modules/truffle/node_modules/truffle-deployer/index.js:68:12
    at /usr/local/lib/node_modules/truffle/node_modules/truffle-deployer/src/deferredchain.js:20:15
    at <anonymous> code: 'MODULE_NOT_FOUND' }

Error is at least more clear.

Reinstalled ethereumjs-wallet globally again. And then it works!

roderik commented 7 years ago

Same issue with the newly released 3.3.0

tcoulter commented 7 years ago

This should be fixed in version 3.4.3. Please create a new issue if it is not. Thanks!