trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 680 forks source link

Filecoin fails with `Cannot find module './src/connector'` #4214

Open ChrisiPK opened 1 year ago

ChrisiPK commented 1 year ago

When running ganache filecoin, the command fails with the following output:

node ➜ /workspaces/fvm-space-warp (main ✗) $ yarn ganache filecoin
yarn run v1.22.18
$ /workspaces/fvm-space-warp/node_modules/.bin/ganache filecoin
ganache v7.7.4 (@ganache/cli: 0.8.3, @ganache/core: 0.8.3)
Cannot find module './src/connector'
Require stack:
- /workspaces/fvm-space-warp/node_modules/@ganache/filecoin/lib/index.js
- /workspaces/fvm-space-warp/node_modules/ganache/dist/node/1.js
- /workspaces/fvm-space-warp/node_modules/ganache/dist/node/cli.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The issue is that the @ganache/filecoin package contains the following code in lib/index.js, line 9:

const connector_1 = require("./src/connector");

This module is not found, as it is not part of the distributed package. Instead, the line must be changed to the following to make it work:

const connector_1 = require("./dist/node/ganache-filecoin.min.js");