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

[Watch mode issue] Webpack watch not working with webpack-cli@4 #1923

Closed
zatloeri opened this issue Oct 11, 2020 · 2 comments · Fixed by #1931
Closed

[Watch mode issue] Webpack watch not working with webpack-cli@4 #1923

zatloeri opened this issue Oct 11, 2020 · 2 comments · Fixed by #1931

Comments

@zatloeri
Copy link

Describe the bug

When using watch mode as given in the following webpack.config.js:

module.exports = () => ({
    entry: path.resolve(__dirname, 'src/index.ts'),
    mode: NODE_ENV,
    watch: true,
    target: 'node',
...
// rest of config (uninportant I think)
...
}

with these dependencies for webpack:

    "webpack": "4.44.2",
    "webpack-cli": "4.0.0"

Webpack will not run with watch mode on.
But with the following deps it will run as expected:

    "webpack": "4.44.2",
    "webpack-cli": "3.3.12"

Also should mention that I am using:

yarn version - 1.22.4
node version - v14.13.0

What is the current behavior?

The compilation starts and finishes without any error, but it does not continue to watch for changes.
It acts as if watch is disabled.

To Reproduce

  1. Clone my example repo
  2. run yarn install
  3. run yarn test
    • Observer the problem
  4. run ./swapDeps.sh (or swap deps manually)
  5. run yarn test
    • Observe functioning watch mode

Alternatively just install the mentioned deps and try to run webpack in watch mode.
Then switch them for the working ones and run again.

Expected behavior

Webpack will run in watch mode consistently with [email protected] as
it works with [email protected]

@zatloeri zatloeri added the Bug label Oct 11, 2020
@rishabh3112
Copy link
Member

Hi @zatloeri 👋🏻
Thanks for reporting.
Yes, I confirm this on my side as well.
Will look into the issue.

@alexander-akait
Copy link
Member

WIP

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

Successfully merging a pull request may close this issue.

3 participants