configuration.entry error (passing an Array of paths)

I’m submitting a bug report

passing an Array of paths causes a webpack validation error

Webpack version:
2.1.0-beta.25

Please tell us about your environment:
macOS Sierra

Current behavior:

passing an Array of paths outputs a WebpackOptionsValidationError

  entry: [
    'webpack/hot/dev-server',
    `webpack-dev-server/client?http://127.0.0.1:${port}`,
    './src/js/script.js',
    './src/css/style.css',
    './src/index.html'
  ],
configuration.entry should be one of these:
   object { <key>: string | [string] } | string | [string]

Expected/desired behavior:

passing an Array of strings should work? ([string])

Author: Fantashit

4 thoughts on “configuration.entry error (passing an Array of paths)

  1. @jlabaj Alright, the issue is reproducible with your repo (for me). As @duivvv and @EvNaverniouk pointed out, the problem seems this string 'webpack/hot/dev-server'. If you remove it from the list this issue does not occur.

    So I thought, maybe webpack tries to add 'webpack/hot/dev-server' to the entry points again because you specified --hot (as described in Docs and this GitHub-Issue) and this causes some broken config array. But even without this parameter the same error message occurs.

    Maybe @gajus can help us?

  2. I get duplicate entries in the array. And so, webpack-dev-server is failing.

    "data": [
              "/Users/vijayst/Documents/react/sam/samwise/node_modules/webpack-dev-server/client/index.js?http://localhost:8080",
              "webpack/hot/dev-server",
              "react-hot-loader/patch",
              "webpack-dev-server/client?http://127.0.0.1:8080",
              "webpack/hot/dev-server",
              "./src/app"
            ]
    
  3. Issue was closed because of inactivity.

    If you think this is still a valid issue, please file a new issue with additional information.

Comments are closed.