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

react-scripts start does not work with lerna run --parallel --stream #8685

Closed
hugomallet opened this issue Mar 21, 2020 · 12 comments · Fixed by #8700
Closed

react-scripts start does not work with lerna run --parallel --stream #8685

hugomallet opened this issue Mar 21, 2020 · 12 comments · Fixed by #8700

Comments

@hugomallet
Copy link

Since react-scripts 3.4.1
On macos 10.15.3 (not tested elsewhere)

running the command :

yarn lerna run --parallel --stream start

does not start the webpack dev server.

If i remove all lerna arguments it works :

yarn lerna run start
@abrcdf1023
Copy link

I have the same issue need rollback to v3.4.0 currently.

@cevr
Copy link

cevr commented Mar 22, 2020

From what I can tell, this only happens when the --stream argument is present

@grahamvo
Copy link

I'm also seeing this issue. Tried removing --stream and it still isn't working.

@rettgerst
Copy link

we've had several issues using lerna exec/run and use the concurrently package in place of lerna exec/run. it requires a bit of setup but overall has more features and fewer bugs.

@grahamvo
Copy link

grahamvo commented Mar 23, 2020

I ended up reverting back to 3.4.0 for the time being until this is fixed.

@hieuxlu
Copy link
Contributor

hieuxlu commented Mar 24, 2020

This change is introduced by commit 7e6d6cd, and can be worked around by commenting out these lines in node_modules/react-scripts/scripts/start.js:168

   
    if (isInteractive || process.env.CI !== 'true') {
      // Gracefully exit when stdin ends
      process.stdin.on('end', function () {
        devServer.close();
        process.exit();
      });
     // Comment out this line
     // process.stdin.resume();
    }

hieuxlu added a commit to hieuxlu/create-react-app that referenced this issue Mar 24, 2020
@ianschmitz ianschmitz added this to the 3.4.2 milestone Mar 24, 2020
@ddc22
Copy link

ddc22 commented Mar 30, 2020

Facing this same issue. I think lerna maybe triggering an end after running a task in parallel.

chuuddo added a commit to chuuddo/shri-2020-hw-ci that referenced this issue Mar 31, 2020
@bukharov
Copy link

bukharov commented Mar 31, 2020

Instead of commenting out the line I set isInteractive to false, but the issue is still there. Setting CI env to true solves it however.

@rolandvar
Copy link

I have the same issue need rollback to v3.4.0 currently.

I have the same issue, rollback to v3.4.0 is working fine for me! Thanks

fguitton added a commit to dsi-icl/acacia that referenced this issue Apr 20, 2020
Reverting CRA to 3.4.0 because of a lerna compatibility issue. Wait for facebook/create-react-app#8685 to resolve

# Conflicts:
#	packages/itmat-ui-react/package.json
#	yarn.lock
@soyFerrero
Copy link

Maybe something like this.

    const shouldLernaExecExit = Boolean(!process.env.LERNA_PACKAGE_NAME)
    const shouldCIExecExit = Boolean(process.env.CI)  
    const shouldInteractiveExecExit = Boolean(isInteractive)

    const shoudExitProcess = [
      shouldLernaExecExit,
      shouldCIExecExit,
      shouldInteractiveExecExit
    ] 

    if (shoudExitProcess.includes(true)) {
      // Gracefully exit when stdin ends
      process.stdin.on('end', function() {
        devServer.close();
        process.exit();
      });
      process.stdin.resume();
    }
  } )
  .catch(err => {
    if (err && err.message) {
      console.log(err.message);
    }
    process.exit(1);
  }); 

@ianschmitz ianschmitz modified the milestones: 3.5, 4.0 May 3, 2020
dermidgen added a commit to mysticcoders/mysticrobots that referenced this issue May 13, 2020
…ensures that we can start / monitor apps in local dev; drops CRA scripts version to get around facebook/create-react-app#8685"
@mwood23
Copy link

mwood23 commented May 19, 2020

Potentially related: #8691

@nmchaves
Copy link

@ianschmitz thanks for reviewing/merging the fix in #8700 🙏 ! I see this issue is associated with CRA's 4.0 milestone right now, but would you potentially consider including the fix in a 3.4.2 "patch" release?

Our team is trying to upgrade TypeScript, so we need to upgrade CRA to 3.4.1. But if we upgrade to 3.4.1, then we face this issue with Lerna.

For now, we're planning to use the workaround suggested in #8685 (comment) while running our application locally. Anyways, thanks for all your work on CRA!

@lock lock bot locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.