Skip to content

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

Closed

Description

@zatloeri

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]

Activity

  1. rishabh3112 commented on Oct 12, 2020

    @rishabh3112
    Contributor

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

  2. alexander-akait commented on Oct 12, 2020

    @alexander-akait
    Member

    WIP

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions