question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

waitFor can only be called for an already started item

See original GitHub issue

Bug report

Actual Behavior

When using watch, the build fails after the first successful build (whenever you change the css).

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
Error: waitFor can only be called for an already started item
    at AsyncQueue.waitFor (./node_modules/webpack/lib/util/AsyncQueue.js:180:5)
    at ./node_modules/webpack/lib/Compilation.js:4621:25
    at processQueue (./node_modules/webpack/lib/util/processAsyncTree.js:50:4)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

Expected Behavior

The build should succeed.

How Do We Reproduce?

When upgrading from 2.3.0 to 2.4.0 this issue was introduced for me.

This is my webpack config (nothing special I guess):

{
                    test: /\.scss$/,
                    include: [path.resolve(__dirname, 'app/Resources/scss')],
                    use: [
                        {
                            loader: MiniCssExtractPlugin.loader,
                            options: {},
                        },
                        {
                            loader: 'css-loader',
                            options: {},
                        },
                        {
                            loader: 'postcss-loader',
                        },
                        {
                            loader: 'sass-loader',
                            options: {
                                sassOptions: {
                                    includePaths: [path.resolve(__dirname, 'node_modules')],
                                },
                            },
                        },
                    ],
                },

Please paste the results of npx webpack-cli info here, and mention other relevant information

  System:
    OS: macOS 11.6
    CPU: (8) arm64 Apple M1
    Memory: 138.34 MB / 16.00 GB
  Binaries:
    Node: 16.9.1 - ~/.nvm/versions/node/v16.9.1/bin/node
    npm: 7.21.1 - ~/.nvm/versions/node/v16.9.1/bin/npm
  Packages:
    babel-loader: ^8.2.2 => 8.2.2 
    copy-webpack-plugin: ^9.0.1 => 9.0.1 
    css-loader: 6.1.0 => 6.1.0 
    css-minimizer-webpack-plugin: 3.0.2 => 3.0.2 
    postcss-loader: 6.1.1 => 6.1.1 
    replace-in-file-webpack-plugin: ^1.0.6 => 1.0.6 
    sass-loader: ^12.2.0 => 12.2.0 
    webpack: 5.58.1 => 5.58.1 
    webpack-cli: 4.9.0 => 4.9.0 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
akphicommented, Oct 19, 2021

Confirmed that this has been fixed after upgrading to webpack@5.59.0 (https://github.com/webpack/webpack/issues/14484)

2reactions
alexander-akaitcommented, Oct 17, 2021

@akphi Yep, the same problem, we will try to fix it in Monday

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: wait.for can only be called inside a fiber - Stack Overflow
I have 2 scipts almost identical with a cascade of function calls nested in a fiber. This one (parsing Tx in a blockchain)...
Read more >
WAITFOR (Transact-SQL) - SQL Server - Microsoft Learn
While executing the WAITFOR statement, the transaction is running and no other requests can run under the same transaction. The actual time ...
Read more >
Testing-library: avoid these mistakes in async tests
As waitFor is non-deterministic and you cannot say for sure how many times it will be called, you should never run side-effects inside...
Read more >
Loader Interface - webpack
A single result can be returned in sync mode. For multiple results the this.callback() must be called. In async mode this.async() must be...
Read more >
threading — Thread-based parallelism — Python 3.11.1 ...
Changed in version 3.7: This module used to be optional, it is now always ... Once a thread object is created, its activity...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found