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

Build failed when using concurently #432

Closed
cojoclaudiu opened this issue Jul 3, 2023 · 17 comments
Closed

Build failed when using concurently #432

cojoclaudiu opened this issue Jul 3, 2023 · 17 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@cojoclaudiu
Copy link

cojoclaudiu commented Jul 3, 2023

Hello,
I'm building my projects using concurently but recently my builds fail with this error

yarn run v1.22.19
$ concurrently --kill-others-on-fail "yarn build:app1" "yarn build:app2"
/node_modules/cliui/build/index.cjs:293
const wrap = require('wrap-ansi');
             ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/wrap-ansi/index.js from /Users/claudiu.cojocaru/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/node_modules/cliui/build/index.cjs:293:14)
    at Object.<anonymous> (/node_modules/yargs/build/index.cjs:1:60678)
    at Object.<anonymous> (/node_modules/yargs/index.cjs:5:30)
    at Object.<anonymous> (/node_modules/concurrently/dist/bin/concurrently.js:30:33) {
  code: 'ERR_REQUIRE_ESM'
}
error Command failed with exit code 1.

I'm using "concurrently": "^8.2.0"

Thank you

@gustavohenke
Copy link
Member

Can you provide any more details?

  • What is "recently"?
  • What are yarn build:app1 and yarn build:app2?
  • Does your build work with an older concurrently version?

Also note that concurrently doesn't use either of the mentioned packages (cliui and wrap-ansi), so without a minimal reproduction code, I'm unlikely to be able to help.

@joneath
Copy link

joneath commented Jul 10, 2023

I'm also facing the same issue but I don't believe concurrently is the cause as @gustavohenke said. Locally my dev server fails to boot with concurrently being the top of the stack for the trace but when I try and build my project in Github actions it fails on cypress. This all occurred last week when I updated a lot of packages so now I get to filter out which one. I'll report back here on which package it was so maybe @cojoclaudiu has the same one and can rollback versions.

@cojoclaudiu
Copy link
Author

@joneath are you using rimraf? I've have this problem when I've got concurrently and rimraf installed, if I remove rimref the error is gone

@joneath
Copy link

joneath commented Jul 10, 2023

I don't have rimraf as a direct dependency but it's included in my yarn.lock as a packaged dependency. My project uses Nuxt and after reverting from the 3.6.x release back to 3.5.3 while also restoring the yarn.lock fixed the issue. I may dig in a bit more to see why the upgrade breaks by project but I may also just wait until the next Nuxt release and try my luck then...

@ghost
Copy link

ghost commented Aug 14, 2023

I got the exact same error. Looking at the lock file, it was supposed to use wrap-ansi@7 but it was using wrap-ansi@v8 even though the lock file was saying otherwise. I had to delete yarn.lock and node_modules and re-run yarn. It's the only way I was able to fix it. Luckily my versions were not too out of date.

@kgarchie
Copy link

kgarchie commented Aug 29, 2023

I have the same issue. I use Nuxt

@paescuj
Copy link
Collaborator

paescuj commented Aug 29, 2023

I have the same issue. I use Nuxt

Also with the latest version? https://github.com/open-cli-tools/concurrently/releases/tag/v8.2.1

@kgarchie
Copy link

I have the same issue. I use Nuxt

Also with the latest version? https://github.com/open-cli-tools/concurrently/releases/tag/v8.2.1

Yeap, but I reckon that the problem may lie in Nuxt

@paescuj
Copy link
Collaborator

paescuj commented Aug 29, 2023

Yea

I have the same issue. I use Nuxt

Also with the latest version? https://github.com/open-cli-tools/concurrently/releases/tag/v8.2.1

Yeap, but I reckon that the problem may lie in Nuxt

Yeah, I guess it's because of conflicting versions of wrap-ansi in the dependency tree and somehow the wrong version gets required.

@paescuj paescuj added dependencies Pull requests that update a dependency file and removed pending for input labels Aug 29, 2023
@NobbZ
Copy link

NobbZ commented Jan 10, 2024

I had this problem using the following dependencies in my SSG for a blog I am preparing:

{
  "dependencies": {
    "@tailwindcss/typography": "^0.5.10",
    "tailwindcss": "^3.4.1"
  },
  "devDependencies": {
    "concurrently": "^8.2.2"
  }
}

Perhaps this more minimal list of deps can help to identify the problem.

In the meantime I was able to mitigate by removing concurrently from the deps and using it installed from my systems package manager, even though this feels unclean.

@gustavohenke
Copy link
Member

Hey @NobbZ, do you mind also sharing your package-lock.json, Node.js and package manager version (npm/pnpm/yarn)?

@NobbZ
Copy link

NobbZ commented Jan 10, 2024

I never committed that and reverted already to only tailwind.

I will try to reproduce later this evening and then provide what I get.

@NobbZ
Copy link

NobbZ commented Jan 10, 2024

I created a gist at https://gist.github.com/NobbZ/df3b2c3491cbb2ae85bdfe88df8ffaa6 that should contain the required information. If anything is missing please ask and I will try to provide it.

@houd1ni
Copy link

houd1ni commented Mar 9, 2024

@NobbZ Had to uninstall concurrently because of this. No adequate hacks that works. It also might just work if the package maintainer just upgrade their deps.

@cojoclaudiu
Copy link
Author

@houd1ni you can still use it if you add to resolutions the dependencies version

@houd1ni
Copy link

houd1ni commented Mar 9, 2024

@houd1ni you can still use it if you add to resolutions the dependencies version

A lot of. I've tracked and added two and more came up. Three and more looks dangerous for me 😄

@gustavohenke
Copy link
Member

gustavohenke commented Mar 10, 2024

Thanks @NobbZ for the reproduction. I managed to reproduce it without using nix.

There are some issues about this on yargs and cliui about this:

Seems like this issue is related to yarn <1.22.22. Once I upgraded yarn, the issue is fixed.
https://github.com/yarnpkg/yarn/releases/tag/v1.22.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

7 participants