question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'htmlparser2' of undefined (v1.0.0)

See original GitHub issue

I am getting the following error when using the latest version of cheerio.

TypeError: Cannot read property 'htmlparser2' of undefined
    at parseWithParse5 (webpack-internal:///../../packages/web-isomorphic/node_modules/cheerio/lib/parse.js:26:64)
    at Function.exports.evaluate (webpack-internal:///../../packages/web-isomorphic/node_modules/cheerio/lib/parse.js:42:68)
    at module.exports (webpack-internal:///../../packages/web-isomorphic/node_modules/cheerio/lib/parse.js:11:21)
    at Function.exports.load (webpack-internal:///../../packages/web-isomorphic/node_modules/cheerio/lib/static.js:27:14)
    at eval (webpack-internal:///./node_modules/@reactant/web-isomorphic/lib/ServerApp.js:96:37)
    at Generator.next (<anonymous>)
    at step (webpack-internal:///./node_modules/@reactant/web-isomorphic/lib/ServerApp.js:60:191)
    at eval (webpack-internal:///./node_modules/@reactant/web-isomorphic/lib/ServerApp.js:60:361)
    at <anonymous>

I traced the source of the issue to the following line of code.

https://github.com/cheeriojs/cheerio/blob/v1.0.0/lib/parse.js#L27

This really caught me off-guard because the v1.0.0-rc version started downloading instead of the stable version I was using. A release candidate should NEVER be tagged as latest.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hutbercommented, Jul 2, 2019

blimey!!!

1reaction
fb55commented, Jun 26, 2019

I assume this is fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest + enzyme: TypeError: Cannot read property 'htmlparser2 ...
I'm using jest and enzyme to build this test, but I'm having this error when I build it. This is the test import...
Read more >
htmlparser2 - npm
Fast & forgiving HTML/XML parser. Latest version: 8.0.1, last published: 8 months ago. Start using htmlparser2 in your project by running ...
Read more >
uncaught typeerror: cannot read properties of undefined (reading ...
In your example Uncaught TypeError: Cannot read properties of undefined (reading 'replace' ) can occur only if your variables song and/or artist are ......
Read more >
nodejs request npm post body undefined Code Example
app.use(express.json()) // To parse the incoming requests with JSON payloads ... Cannot read property 'send' of undefined · http get response body node...
Read more >
list of all node.js modules created on June 24, 2013
=adamvr 2013-04-08 14:43 0.0.6 dom javascript xui adapter a set of libraries ... api stream node wrapper async http append append the properties...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found