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

Cannot read properties of undefined (reading 'load') #40

Closed
olga-cr opened this issue Aug 23, 2024 · 2 comments
Closed

Cannot read properties of undefined (reading 'load') #40

olga-cr opened this issue Aug 23, 2024 · 2 comments

Comments

@olga-cr
Copy link

olga-cr commented Aug 23, 2024

Started running into this issue with pretty much any payload. E.g.
const truncated = truncate('<p><img src="xxx.jpg">Hello from earth!</p>', 2, { byWords: true });
throws an error. Stacktrace:

uncaughtException: Cannot read properties of undefined (reading 'load')
TypeError: Cannot read properties of undefined (reading 'load')
    at $742b69707032309e$var$truncate (/home/user/repo/packages/api/node_modules/truncate-html/dist/truncate.cjs.js:154:55)

Looks like the line in question is $ = (0, ($parcel$interopDefault($1J0WF$cheerio))).load(${html}, {.
Downgrading to 1.1.1 does not seem to fix this.

@oe
Copy link
Owner

oe commented Aug 23, 2024

Please upgrade to version v1.1.2 and make sure that the version of cheerio is 1.0.0-rc.12 (check with yarn why cheerio, or check the node_modules folder to verify).

It's a problem caused by the stable release of cheerio v1.0.0. related links: #39 , release v1.1.2

@oe
Copy link
Owner

oe commented Sep 6, 2024

If this problem persists, please reopen the issue. In the meantime, kindly close the current instance.

@oe oe closed this as completed Sep 6, 2024
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