cheerio.load is not a function

Created on 12 Mar 2017  路  2Comments  路  Source: cheeriojs/cheerio

Hi, I am getting while using the mjml-core library, I am using webpack to build my system. This error comes after building the project, and I am using the bundled code inside another .js file.

var $ = cheerio.load('', { decodeEntities: false });
                ^
TypeError: cheerio.load is not a function

in bundle.js __webpack_require_ returns {} for cheerio.

All 2 comments

I'm assuming that you already have a prior line in your code like:
let cheerio = require('cheerio');
If so, you are going to need to dig through what changes all that bundling did to the original files.

This appears to be a problem with your build configuration. If you are able to provide a file (or set of files) that demonstrates this problem, we may be able to help, but it seems unlikely that Cheerio itself is the source of the problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevorfrese picture trevorfrese  路  4Comments

francoisromain picture francoisromain  路  5Comments

dandv picture dandv  路  5Comments

askie picture askie  路  4Comments

unicrus picture unicrus  路  4Comments