ERROR in (webpack)-dev-server/client/socket.js
Module not found: Error: Can't resolve 'sockjs-client' in '/usr/local/lib/node_modules/webpack-dev-server/client'
@ (webpack)-dev-server/client/socket.js 1:13-37
@ (webpack)-dev-server/client?http://localhost:8888
@ multi (webpack)-dev-server/client?http://localhost:8888 ./src/js/jwplayer.js
ERROR in (webpack)-dev-server/client/overlay.js
Module not found: Error: Can't resolve 'ansi-html' in '/usr/local/lib/node_modules/webpack-dev-server/client'
@ (webpack)-dev-server/client/overlay.js 3:15-35
@ (webpack)-dev-server/client?http://localhost:8888
@ multi (webpack)-dev-server/client?http://localhost:8888 ./src/js/jwplayer.js
ERROR in (webpack)-dev-server/client/overlay.js
Module not found: Error: Can't resolve 'html-entities' in '/usr/local/lib/node_modules/webpack-dev-server/client'
@ (webpack)-dev-server/client/overlay.js 4:15-39
@ (webpack)-dev-server/client?http://localhost:8888
@ multi (webpack)-dev-server/client?http://localhost:8888 ./src/js/jwplayer.js
If the current behavior is a bug, please provide the steps to reproduce.
Unfortunately our project is private, but this is the command we use:
webpack-dev-server -w --env.debug --port 8888 --output-public-path /bin-debug/
What is the expected behavior?
webpack-dev-server
is able to host our files without errors.
Please mention your webpack and Operating System version.
Any 2 or 3 version (tested with 2.6.1, 2.7.0, 3.0.0, 3.2.0). MacOS Sierra. webpack-dev-server version 2.5.1
changed the title
Webpack builds, but dev-server fails to host with cannot resolve * in /usr/local/lib/node_modules/webpack-dev-server/client'
Webpack builds, but dev-server fails to find modules
Jul 13, 2017
Webpack builds, but dev-server fails to find modules
Webpack builds, but dev-server fails to find it's own modules
Jul 13, 2017
webpack-dev-server --no-inline
Do you use extract-text-webpack-plugin
or html-webpack-plugin
in your project ?
Please check their version is matched with webpack
and webpack-dev-server
.
catt-wuyang, blooming, vxow, bentedder, artyomtrityak, onury, vdakalov, isotope3, yurakis, androidovshchik, and 16 more reacted with thumbs up emoji
phamhongphuc, ajmeese7, dhruvgaloriya, dawnwages, dempire1998, mutoe, hibachrach, steffanboodhoo, VictorUvarov, jamesjianpeng, and 3 more reacted with confused emoji
All reactions
I had this problem because I had only "src" listed for my modules.
I fixed this problem by adding "node_modules" to it.
module.exports = {
resolve: {
modules: ["src", "node_modules"],
AdamAnSubtractM, Selvin11, ShailyAggarwalK, vishal-vp, fernandops26, rpivo, richistron, JohnnyFun, iwnow, z1090, and 3 more reacted with thumbs up emoji
richistron, TangoYankee, soulchainer, and acarlos1941 reacted with heart emoji
richistron reacted with rocket emoji
All reactions
I had this problem because I had only "src" listed for my modules.
I fixed this problem by adding "node_modules" to it.
module.exports = {
resolve: {
modules: ["src", "node_modules"],
This was my issue as well. Thanks @pmw57
I´ve had a similar issue in a TypeScript based Webpack project
ERROR in (webpack)-dev-server/client?http://localhost:3100
Module not found: Error: Can't resolve 'strip-ansi' in 'MYPATH/node_modules/webpack-dev-server/client'
@ (webpack)-dev-server/client?http://localhost:3100 6:16-37
@ multi (webpack)-dev-server/client?http://localhost:3100 ./src/index.ts
It was solved by adding the .js
extension to the resolved extensions.
module.exports = {
resolve: {
extensions: [".ts", ".js"], // Added ".js" here
};```
Jimmydalecleveland, raphaelschaad, reddevil22, jaimesangcap, saurssauravjs, ahnwarez, mutoe, mcfarlanedev, fergalhanley, 0x-jerry, and 105 more reacted with thumbs up emoji
ryanzheng1998, jsdevtom, and laneme reacted with laugh emoji
vprothais, whtiehack, samuraime, Frogglet, heuperman, epeterson320, renickbuettner, ma2ciek, danny-vvv, wackyjoker, and 15 more reacted with hooray emoji
bring-shrubbery, whtiehack, Frogglet, epeterson320, renickbuettner, wackyjoker, krislao, macabeus, ryanzheng1998, ZlatyChlapec, and 11 more reacted with heart emoji
ryanzheng1998, chrishna1, wwwtyro, jsdevtom, TrueMoein, and Guck111 reacted with rocket emoji
All reactions
webpack-dev-server --no-inline
Do you use extract-text-webpack-plugin
or html-webpack-plugin
in your project ?
Please check their version is matched with webpack
and webpack-dev-server
.
Please can you elaborate why does --no-inline work? It worked in my machine but I am not sure why it works?
What worked for me was adding the following extensions to my webpack.config:
module.exports = {
resolve: {
extensions: [".ts", ".js", "json"], // Added ".js" and ".json" here