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.

Concurrent Compilation Error

See original GitHub issue

Caching the webpack compiler, introduced in PR #109, causes an error when compiling multiple files concurrently.

This issue is not related to gulp however I ran into it when using gulp to compile my project. I am working with a mono-repo where I have a services directory which contains several microservices. each microservice has its own src directory which contains an index.js.

I use the following code to compile each micro service individually

const gulp = require('gulp')
const compiler = require('webpack')
const webpack = require('webpack-stream')

...

gulp.task('webpack', function () {
  const tasks = getDirectories(`./services`).map((dir) => {
    return gulp.src(join(dir, 'src/index.js'))
      .pipe(webpack(require('./webpack.config.js'), compiler))
      .pipe(gulp.dest(join(dir, 'dist/')))
  })

  return merge(tasks)
})

webpack-stream 5.0.0 works as expected and produces a compiled version of each microservice which is stored in a dist directory alongside its respective src directory.

webpack-stream 5.1.0 introduced caching and reuses the same webpack instance for each compilation task which results in the following error:

ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:23
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
danieldiekmeiercommented, Aug 28, 2019

I came across the same error and fixed it by downgrading to 5.0, but it would be nice to have the cache working correctly/reliably.

3reactions
WillsB3commented, Jan 14, 2019

I’m also seeing this issue when using webpack-stream in combination with gulp.parallel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConcurrentCompilationError: You ran Webpack twice
ConcurrentCompilationError: You ran Webpack twice. Each instance only supports a single concurrent compilation at a time. at Compiler.watch ...
Read more >
Applying FND Patch 25452805: Error Out :Compiling package ...
During Online Patching cycle, new version of FNDRSRUN.fmx is applied. Thereafter the form will not compile as part of patch application, giving ...
Read more >
Error while compiling on WSL with Max Parallel Compilation ...
When the project C/C++ - General parameter named “Max Parallel Compilation Jobs” is higher than 1, compilation failed with this error:
Read more >
Parallel Compilation - Guide to Rustc Development
As of August 2022, the only stage of the compiler that is already parallel is codegen. Some parts of the compiler already have...
Read more >
Always recompiling and not breaking on error : IDEA-52295
Parallel compilation : Always recompiling and not breaking on error ... This will yield the following compile configuration [[A], [B, C], [D], [E]]...
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