Cheerio: Unable to process build with webpack

Created on 6 Dec 2016  路  2Comments  路  Source: cheeriojs/cheerio

I get the following issue when i try to run this with webpack (using the scrape-it module)
https://github.com/IonicaBizau/scrape-it

Full stack trace:

ERROR in ./~/scrape-it/~/cheerio-req/~/cheerio/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./package in /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio
resolve file
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package doesn't exist
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.webpack.js doesn't exist
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.web.js doesn't exist
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.js doesn't exist
resolve directory
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package doesn't exist (directory default file)
  /Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package/package.json doesn't exist (directory description file)
[/Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package]
[/Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.webpack.js]
[/Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.web.js]
[/Users/Spicycurryman/Desktop/Main/styell/node_modules/scrape-it/node_modules/cheerio-req/node_modules/cheerio/package.js]
 @ ./~/scrape-it/~/cheerio-req/~/cheerio/index.js 11:18-38

I've tried update Cheerio inside the scrape-it module itself and outside, but no luck.

It exists.
screen shot 2016-12-05 at 4 35 52 pm

EDIT:

Here's my webpack.config.js file

var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var request = require('request');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');


module.exports = {
    entry: "./main.js",
    output: {
        path: __dirname,
        filename: "bundle.js"
    },
    module: {
    loaders: [
      { test: /\.json$/, loader: 'json-loader' }
        ]
    },
    resolve: {
        extensions: ['', '.webpack.js', '.web.js', '.js']
    },
    node: {
        console: 'empty',
        fs: 'empty',
        net: 'empty',
        tls: 'empty'
    }
}

How can this be resolved? Why is this occurring?

Most helpful comment

Try adding .json to resolve.extensions.

All 2 comments

Try adding .json to resolve.extensions.

@fb55 Looks like that did the trick. Thanks 馃憤 I'm now getting an unrelated error now though :(

http://stackoverflow.com/questions/41004659/using-webpack-with-mongoose-mongoose-model-is-not-a-function

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dandv picture dandv  路  5Comments

trevorfrese picture trevorfrese  路  4Comments

robogeek picture robogeek  路  4Comments

Canop picture Canop  路  3Comments

collegepinger picture collegepinger  路  3Comments