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

Cheerio dependancy error #39

Closed
sthompson232 opened this issue Aug 15, 2024 · 2 comments
Closed

Cheerio dependancy error #39

sthompson232 opened this issue Aug 15, 2024 · 2 comments

Comments

@sthompson232
Copy link

I have suddenly started receiving the following error when installing truncate-html latest version. This looks like a dependancy update error from cheerio. Perhaps cheerio needs to be pinned at a specific version.

[ERROR] No matching export in "node_modules/cheerio/dist/browser/index.js" for import "default"

    node_modules/truncate-html/dist/truncate.es.js:1:7:
      1 │ import $e9N8g$cheerio from "cheerio";
        ╵        ~~~~~~~~~~~~~~


 ERROR  error while updating dependencies:
Error: Build failed with 1 error:
node_modules/truncate-html/dist/truncate.es.js:1:7: ERROR: No matching export in "node_modules/cheerio/dist/browser/index.js" for import "default"
@oe
Copy link
Owner

oe commented Aug 15, 2024

Cheerio has released stable v1.0 a few days ago, but its APIs are slightly different from the latest beta version 1.0.0-rc.12.

I'm working on it now, but before that you can override the cheerio version to fix it.

Override version by adding fields to package.json.

If you are using npm

{
  ...
  "overrides": {
    "cheerio": "1.0.0-rc.12"
  },
  ...
}

If you are using pnpm

{
  ...
  "pnpm": {
    "overrides": {
      "cheerio": "1.0.0-rc.12"
    }
  },
  ...
}

if you are using yarn

{
  ...
  "resolutions": {
    "cheerio": "1.0.0-rc.12"
  },
  ...
}

@oe
Copy link
Owner

oe commented Aug 15, 2024

[email protected] has just been released, cheerio has been pinned to 1.0.0-rc.12.

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

No branches or pull requests

2 participants