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

Make Yari compatible with cheerio 1.0.0 #11618

Closed
3 tasks done
Josh-Cena opened this issue Aug 9, 2024 · 1 comment · Fixed by #11752
Closed
3 tasks done

Make Yari compatible with cheerio 1.0.0 #11618

Josh-Cena opened this issue Aug 9, 2024 · 1 comment · Fixed by #11752
Labels
dependencies Pull requests that update a dependency file effort: small This task is a small effort. has PR Issues that already have a PR p2 We want to address this but may have other higher priority items.

Comments

@Josh-Cena
Copy link
Member

Summary

I have a project that always builds content with latest dependencies, and it currently fails because Yari does not work with cheerio 1.0.0.

URL

https://github.com/jc-verse/mdn-graph/actions/runs/10326431785/job/28589930733

Reproduction steps

  1. In mdn/content, delete yarn.lock.
  2. Run yarn install.
  3. Run yarn build.

Expected behavior

Builds

Actual behavior

yarn run v1.22.22
$ env-cmd --silent cross-env CONTENT_ROOT=files BUILD_OUT_ROOT=build yari-build --nohtml
file:///home/runner/work/mdn-graph/mdn-graph/content/node_modules/@mdn/yari/kumascript/src/info.js:1
import cheerio from "cheerio";
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:171:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:2[5](https://github.com/jc-verse/mdn-graph/actions/runs/10326431785/job/28589930733#step:7:6)4:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:2[6](https://github.com/jc-verse/mdn-graph/actions/runs/10326431785/job/28589930733#step:7:7))
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

You need to replace this import with named imports. See https://cheerio.js.org/blog/cheerio-1.0.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Linux

Screenshot

No response

Anything else?

No response

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Aug 9, 2024
@caugner
Copy link
Contributor

caugner commented Sep 6, 2024

We won't upgrade to cheerio 1.0.0, because we're replacing the build system and will no longer depend on cheerio in the future, but I opened #11752 to avoid the issue you're running into.

@caugner caugner added dependencies Pull requests that update a dependency file p2 We want to address this but may have other higher priority items. has PR Issues that already have a PR effort: small This task is a small effort. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Sep 6, 2024
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 effort: small This task is a small effort. has PR Issues that already have a PR p2 We want to address this but may have other higher priority items.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants