rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[Rush] Rush and Vue3 CLI hello world results in ERROR: Child already exists

Open raseesink opened this issue 6 years ago • 14 comments

Is this a feature or a bug?

  • [ ] Feature
  • [ X] Bug

Please describe the actual behavior. After creating a new project with the vue cli rush gives the error "ERROR: Child already exists" when running rush update --purge

If the issue is a bug, how can we reproduce it? Please provide detailed steps and include a GitHub branch if applicable. Your issue will get resolved faster if you can make it easy to investigate. Reproduction repository: https://github.com/raseesink/issueReproductionRushVueChildAlreadyExists

Clone and run rush update --purge. Tested on a mac with nodejs 12.19.0 and 15.0.1. Version on linked repository is with all the latest versions. initial project created with vue cli version 3. Answers to questions saved in homedir/.vuerc

What is the expected behavior? Install dependencies, create shrinkwrap file. No error.

If this is a bug, please provide the tool version, Node.js version, and OS. Mac Rush 5.35.1 Node 12.19.0 (LTS) and 15.0.1 NPM 7.0.3

raseesink avatar Nov 02 '20 20:11 raseesink

In your repro, Rush is trying to link two versions (5.2.1 and 3.1.1) of fork-ts-checker-webpack-plugin to the same project. This appears to be caused by an alias of fork-ts-checker-webpack-plugin-v5 to fork-ts-checker-webpack-plugin referenced in @vue/cli-plugin-typescript.

You're using a newer version of NPM that Rush has been tested with. Historically, NPM has had more issues than we've been able to deal with, so our support stagnated in version 4. Is there a reason you need to use NPM? I just tried your repo with PNPM version 4.14.4 (the version this repo is using) and, after some tsconfig tweaks, things are building fine.

iclanton avatar Nov 05 '20 02:11 iclanton

We use better-npm-audit which doesn't work without npm: https://www.npmjs.com/package/better-npm-audit. We chose npm as we expected that the more popular library would work better with most other software. But we can try to replace that with pnpm audit.

Our main repo is larger, we tried converting it to pnpm and this had been largely succesfull. So this looks like a viable workaround. The unittest in vue don't seem to work however, we are still trying to fix those.

I created a branch in the repo with the work we have done there to convert it to pnpm

raseesink avatar Nov 09 '20 21:11 raseesink

Turns out the unittest don't even work without rush, so that looks like a vue cli bug.

raseesink avatar Nov 09 '20 21:11 raseesink

We chose npm as we expected that the more popular library would work better with most other software.

From my observations, I think the industry has largely moved from NPM to Yarn. We decided to focus our support on PNPM because it's far more strict than Yarn or NPM, so it will catch issues with dependency specification much more quickly. There are some docs here that provide some more background.

iclanton avatar Nov 11 '20 01:11 iclanton

Did you try this with vite?

I could use Vue very well with Rush and Vite.

renoirb avatar Sep 29 '21 03:09 renoirb

I get the same Error with spfx projects linked to a custom npm library using npm.

rush update ends with error "child already exists".

Link631 avatar Feb 12 '22 12:02 Link631

I added log output and the offending package is vue-loader. It is a dependency of vue-cli-service but is required in two versions: "@vue/vue-loader-v15": "npm:vue-loader@^15.9.7" and "vue-loader": "^17.0.0"` Rush seems to choke on the -v15 alias

tkalmar avatar Mar 07 '22 16:03 tkalmar

@tkalmar @raseesink Is there any solution if using npm?

DawnSouther avatar Apr 27 '22 06:04 DawnSouther

@DawnSouther the issue should be fixed for npm also, all you have to do is update your rush version to 5.63.0

tkalmar avatar Apr 27 '22 06:04 tkalmar

@tkalmar Thank you! It's resolved

DawnSouther avatar Apr 27 '22 06:04 DawnSouther

@tkalmar @DawnSouther could you share more info, thanks? I still got 'ERROR: Child already exists: mocha' after upgrading to rush 5.63.0.

cqcmdwym avatar Apr 28 '22 02:04 cqcmdwym

@cqcmdwym Maybe you can try to modify the version of mocha, I can solve the problem of vue and upgrade to 5.0.0

DawnSouther avatar Apr 28 '22 04:04 DawnSouther

Thanks, could you share the snippet(npm alias) of vue in package.json? Thanks.

cqcmdwym avatar Apr 29 '22 06:04 cqcmdwym

I'm also getting the aforementioned error using NPM on Rush 3.69 when using Docusaurus, which uses an npm alias to redirect react-loadable to its own implementation of @docusarus/react-loadable like this:

dependencies {
    "@docusaurus/react-loadable": "5.5.2",
    .........
    "react-loadable": "npm:@docusaurus/[email protected]",
    .........
}

https://github.com/facebook/docusaurus/blob/v2.0.0-beta.20/packages/docusaurus/package.json

Reisclef avatar May 11 '22 14:05 Reisclef