Webpack-dev-server: v4.0.0-beta.0: Error: No dependency factory available for this dependency type: EntryDependency

Created on 30 Nov 2020  路  2Comments  路  Source: webpack/webpack-dev-server

  • Operating System: Ubuntu
  • Node Version: v14.15.0
  • NPM Version: 6.14.8
  • webpack Version: 5.9.0
  • webpack-dev-server Version: v4.0.0-beta.0
  • [x] This is a bug
  • [ ] This is a modification request

Code

// webpack.config.js
  entry: {},

Expected Behavior

No error

Actual Behavior

Error:

<e> [webpack-dev-middleware] Error: No dependency factory available for this dependency type: EntryDependency
<e>     at Compilation.addModuleChain (.../node_modules/webpack/lib/Compilation.js:1632:5)
<e>     at Compilation._addEntryItem (.../node_modules/webpack/lib/Compilation.js:1742:8)
<e>     at Compilation.addEntry (.../node_modules/webpack/lib/Compilation.js:1673:8)
<e>     at .../node_modules/webpack-dev-server/lib/utils/DevServerPlugin.js:163:29
<e>     at new Promise (<anonymous>)
<e>     at .../node_modules/webpack-dev-server/lib/utils/DevServerPlugin.js:162:15
<e>     at Array.map (<anonymous>)
<e>     at .../node_modules/webpack-dev-server/lib/utils/DevServerPlugin.js:160:29
<e>     at Hook.eval [as callAsync] (eval at create (.../node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:38:17)
<e>     at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (.../node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)

For Bugs; How can we reproduce the behavior?

I have only entrypoints generated by plugins (ModuleFederationPlugin) and I get this error when I set empty object {} to entry.

As a workaround I can set path to empty js file. In this case, I get no error.

All 2 comments

Please use the issue template, otherwise it will be closed

Reproducible example: https://github.com/Semigradsky/webpack-dev-server-2876

yarn build works
yarn start returns error

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tulika21-zz picture tulika21-zz  路  3Comments

adiachenko picture adiachenko  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments

mrdulin picture mrdulin  路  3Comments

gimmi picture gimmi  路  3Comments