Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loader not finding truffle config file. #19

Open
braheezy opened this issue May 13, 2019 · 1 comment
Open

Loader not finding truffle config file. #19

braheezy opened this issue May 13, 2019 · 1 comment

Comments

@braheezy
Copy link

Issue

Recieving "ValidationError: truffle-solidity-loader Invalid Options" when trying to import a solidity file.

Steps to Reproduce

  1. Create truffle project with a solidity contract.
  2. In truffle-config.js file, define a network.
  3. Install webpack to the project.
  4. In webpack-confg.js, use the truffle-solidity-loader.
  5. Run webpack-dev-server.

Expected Behavior

The file to build.

Actual Results

Build fail.

ERROR in ./ethereum/contracts/Account.sol
Module build failed (from ./node_modules/truffle-solidity-loader/index.js):
ValidationError: truffle-solidity-loader Invalid Options
options should have required property 'network'
at validateOptions (/home/mbraha/Work/dapps/primis/node_modules/schema-utils/src/validateOptions.js:32:11)
at Object.module.exports (/home/mbraha/Work/dapps/primis/node_modules/truffle-solidity-loader/index.js:57:3)
@ ./src/factory.js

Environment

  • Operating System: CentOS 7 x64
  • Truffle version: 5.0.9
  • Ganache version: 2.0.1
  • node version: 11.13.0
  • npm version: 6.9.0

webpack.config.js snippet:

module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /(node_modules)/,
        loader: "babel-loader",
        options: { presets: ["@babel/env"] }
      },
      {
        test: /\.css$/,
        use: ["style-loader", "css-loader"]
      },
      {
        test: /\.sol$/,
        exclude: /node_modules/,
        loader: "truffle-solidity-loader",
        options: {
          network: "development"
        }
      }
    ]
  },

truffle-config.js snippet:

networks: {
    development: {
      host: "127.0.0.1", // Localhost (default: none)
      port: 8545, // Standard Ethereum port (default: none)
      network_id: "*" // Any network (default: none)
    }
  },
@shailendrakumaromkar
Copy link

Hi,

Any update on this issue ?
I am getting below error in Windows 10

ERROR in ./contracts/ToDo.sol
Module build failed (from ./node_modules/truffle-solidity-loader/index.js):
ValidationError: truffle-solidity-loader Invalid Options

options should have required property 'network'

at validateOptions (C:\Users\om\Desktop\Personal\Study\Blockchain\EatTheBlock\ToDoApp_30Mar\node_modules\schema-utils\src\validateOptions.js:32:11)
at Object.module.exports (C:\Users\om\Desktop\Personal\Study\Blockchain\EatTheBlock\ToDoApp_30Mar\node_modules\truffle-solidity-loader\index.js:57:3)

@ ./app/js/index.js 3:12-47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants