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

Migrate away from yarn 1/classic #1444

Closed
jagthedrummer opened this issue May 7, 2024 · 4 comments · Fixed by #1445
Closed

Migrate away from yarn 1/classic #1444

jagthedrummer opened this issue May 7, 2024 · 4 comments · Fixed by #1445

Comments

@jagthedrummer
Copy link
Contributor

jagthedrummer commented May 7, 2024

We're running on yarn 1.22.22 by default and the 1.x line has been deprecated since 2020.

This has started to cause problems due to depfu trying to make some updates that cause the tests to fail.

The failures look like this:

yarn exec v1.22.22
/home/runner/work/bullet_train/bullet_train/tmp/starter/node_modules/cliui/build/index.cjs:291
const stringWidth = require('string-width');
                    ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/bullet_train/bullet_train/tmp/starter/node_modules/string-width/index.js from /home/runner/work/bullet_train/bullet_train/tmp/starter/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /home/runner/work/bullet_train/bullet_train/tmp/starter/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/runner/work/bullet_train/bullet_train/tmp/starter/node_modules/cliui/build/index.cjs:291:21) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.12.2
error Command failed.
Exit code: 1

Other folks have run in to this and it seems like the best solution is to upgrade off of yarn 1.

@gazayas
Copy link
Contributor

gazayas commented May 7, 2024

I've been curious about this for a while, and we temporarily had things working with v3.5.1 back in #754, but I haven't looked at it in a bit. That PR might have some hints though.

@jagthedrummer
Copy link
Contributor Author

@gazayas that's interesting, and I'd forgotten about that PR. I don't find anything in the contents of that PR that actually pins yarn to a version. So maybe you were just using 3.5.1 locally? And we were still running 1.22.22 in CI?

@gazayas
Copy link
Contributor

gazayas commented May 7, 2024

@jagthedrummer I don't quite remember the CI setup at that point, but yes, I was running v3.5.1 locally. It created all these files in .yarn/ which I put in .gitignore, but it might be a different setup in v4.

It seems like you got v4 to pass on CI though? I'll see if I can test out the branch locally soon.

@jagthedrummer
Copy link
Contributor Author

jagthedrummer commented May 7, 2024

@gazayas Looks like we probably want to tweak .gitignore to not ignore quite so much. https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

I wonder if version 3.5.1 might have put some kind of version identifier somewhere in .yarn/ to keep track of which version to use.

I'll add the .gitignore tweaks to #1445 tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants