Collins Orlando
Collins Orlando

Reputation: 1691

Why isn't webpack watch working?

I'm having a quite peculiar issue. Everything was working just fine but suddenly webpack watch started throwing the following error:

ERROR in multi ./src/index.js watch
Module not found: Error: Can't resolve 'watch' in 'C:\xampp\htdocs\ReactJS\RecipeBox' @ multi ./src/index.js watch

I have no clue as to why this is happening, especially given that webpack runs just fine and transpiles everything as intended. I want it to watch my files as I work and this is where the problem arises. I'd appreciate any help.

I'm not sure how relevant they are, but shots of both my project structure and dependencies in the package.json file are displayed below.

Project structure

enter image description here

Dependencies - package.json

enter image description here

Upvotes: 1

Views: 296

Answers (1)

Michael Jungo
Michael Jungo

Reputation: 33010

Arguments you pass to the webpack CLI are used as entry points. You want to use the --watch option, not add watch as an entry. The correct command is:

webpack --watch

Upvotes: 2

Related Questions